Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into incorrect-public-ov…
Browse files Browse the repository at this point in the history
…erride

# Conflicts:
#	src/META-INF/plugin.xml
  • Loading branch information
anibyl committed Feb 26, 2016
2 parents 1f00534 + ea1c67b commit 02d8b93
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<li>Error highlighting added for variable redefinition (issue #431)</li>
<li>Fix generic sub-type resolving when import just type-module (issue #435)</li>
<li>Extensions: using variants and resolving for children and implementations of base class or interface added (issue #433)</li>
<li>Fix typedef generic params resolving (issue #304)</li>
<li>Incorrect “public” modifier when override methods fixed (issue #439)</li>
</ul>
<p>0.9.9: (community release)</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public String getQualifiedName() {

if(name == null && this instanceof HaxeAnonymousType) {
// restore name from parent
HaxeTypedefDeclaration typedefDecl = (HaxeTypedefDeclaration)(getParent().getParent());
if(typedefDecl != null) {
name = typedefDecl.getName();
final PsiElement typedefDecl = getParent().getParent();
if(typedefDecl != null && typedefDecl instanceof HaxeTypedefDeclaration) {
name = ((HaxeTypedefDeclaration)typedefDecl).getName();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@ public static HaxeClassResolveResult tryResolveClassByTypeTag(PsiElement element
return specialization.get(element, type.getText());
}

if(haxeClass instanceof HaxeTypedefDeclaration) {
HaxeClassResolveResult temp = HaxeClassResolveResult.create(haxeClass, specialization);
temp.specializeByParameters(type.getTypeParam());
specialization = temp.getSpecialization();
}

HaxeClassResolveResult result = getHaxeClassResolveResult(haxeClass, specialization.getInnerSpecialization(element));
if (result.getHaxeClass() != null) {
result.specializeByParameters(type == null ? null : type.getTypeParam());
Expand Down
5 changes: 5 additions & 0 deletions testData/completion/references/NullTypedef.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Main {
function foo(a:Null<String>) {
a.<caret>
}
}
2 changes: 2 additions & 0 deletions testData/completion/references/NullTypedef.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASIC 1 INCLUDES
split
9 changes: 9 additions & 0 deletions testData/completion/references/RefTypedef.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
typedef Ref<T> = {
function get():T;
}

class Main {
function foo(a:Ref<String>) {
a.get().<caret>
}
}
2 changes: 2 additions & 0 deletions testData/completion/references/RefTypedef.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASIC 1 INCLUDES
split
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,16 @@ public void testImportGenericSubType() throws Throwable {
doTestVariantsInner("ImportGenericSubType.txt");
}

public void testNullTypedef() throws Throwable {
myFixture.configureByFiles("NullTypedef.hx", "std/StdTypes.hx", "std/String.hx");
doTestVariantsInner("NullTypedef.txt");
}

public void testRefTypedef() throws Throwable {
myFixture.configureByFiles("RefTypedef.hx", "std/String.hx");
doTestVariantsInner("RefTypedef.txt");
}

// @TODO: Temporarily disabled. Not being recognized for an unknown reason.
/*
public void testExtensionMethod1() throws Throwable {
Expand Down

0 comments on commit 02d8b93

Please sign in to comment.