IDEA-179184 Go to file regression -- no longer matches on forward slashes in Windows

This commit is contained in:
peter
2017-09-19 10:37:59 +02:00
parent a0d0315bfa
commit 942e33f28a
2 changed files with 4 additions and 2 deletions
@@ -402,8 +402,8 @@ class Intf {
}
void "test prefer exact case match"() {
def upper = myFixture.addClass("class SOMECLASS {}")
def camel = myFixture.addClass("class SomeClass {}")
def upper = myFixture.addClass("package foo; class SOMECLASS {}")
def camel = myFixture.addClass("package bar; class SomeClass {}")
assert getPopupElements(new GotoClassModel2(project), 'SomeClass') == [camel, upper]
assert getPopupElements(new GotoFileModel(project), 'SomeClass.java') == [camel.containingFile, upper.containingFile]
}
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
@@ -116,6 +117,7 @@ public class GotoFileItemProvider extends DefaultChooseByNameItemProvider {
for (Object o : myModel.getElementsByName(fileName, everywhere, pattern)) {
String fullName = myModel.getFullName(o);
if (o instanceof PsiFileSystemItem && fullName != null) {
fullName = FileUtilRt.toSystemIndependentName(fullName);
FList<TextRange> fragments = fullMatcher.matchingFragments(fullName);
if (fragments != null && !fragments.isEmpty()) {
group.add((PsiFileSystemItem)o);