Skip to content

Commit

Permalink
Merge pull request #406 from eliasku/bugfix/issue405
Browse files Browse the repository at this point in the history
Fix resolution of types and variables with similar names (Issue #234 and #405)
  • Loading branch information
EBatTiVo committed Feb 7, 2016
2 parents 944d521 + 9242c1a commit d44634b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 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>Fix extending anonymous types. (Issue #353)</li>
<li>Error annotation if type extends itself</li>
<li>Fix qualified name resolving for ancillary types declaration (multiple types inside .hx file)</li>
<li>Fix for resolving variables with names as any type name (Issues #405, #234)</li>
</ul>
<p>0.9.8: (community release)</p>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,13 @@ private PsiFile resolveImportFile(HaxeReference reference) {
VirtualFile importVFile = importDir == null ? null : importDir.findChild(fileName);
importPsiFile = importVFile == null ? null : PsiManager.getInstance(reference.getProject()).findFile(importVFile);
if (importPsiFile != null) {
break;
// for addition case-sensetive check because find file is not case-sensetive
if(!fileName.equals(importPsiFile.getName())) {
importPsiFile = null;
}
else {
break;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ else if (implementOrExtendSameClass) {
return resolveResult;
}
// std Array
if ("Array".equalsIgnoreCase(resolveResultHaxeClass.getQualifiedName())) {
if ("Array".equals(resolveResultHaxeClass.getQualifiedName())) {
HaxeClassResolveResult arrayResolveResult = resolveResult.getSpecialization().get(resolveResultHaxeClass, "T");

if (arrayResolveResult != null) {
Expand Down
7 changes: 7 additions & 0 deletions testData/completion/references/LowerCase.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class LowerCase {
private function print(array:Array<String>){
for(string in array) {
string.<caret>
}
}
}
2 changes: 2 additions & 0 deletions testData/completion/references/LowerCase.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 @@ -202,6 +202,11 @@ public void testGenericFromSuperPackage() throws Throwable {
doTestVariantsInner("generic1/clients/Client.txt");
}

public void testLowerCase() throws Throwable {
myFixture.configureByFiles("LowerCase.hx", "com/util/Bar.hx", "std/String.hx", "std/Array.hx", "std/StdTypes.hx");
doTestVariantsInner("LowerCase.txt");
}

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

0 comments on commit d44634b

Please sign in to comment.