mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
goto file: sort files by name-without-extension (IDEA-194877)
This commit is contained in:
@@ -143,6 +143,12 @@ class Intf {
|
||||
assert gotoFile('i') == [i, index]
|
||||
}
|
||||
|
||||
void "test prefer shorter filename match"() {
|
||||
def shorter = addEmptyFile("foo/cp-users.txt")
|
||||
def longer = addEmptyFile("cp-users-and-smth.html")
|
||||
assert gotoFile('cpusers') == [shorter, longer]
|
||||
}
|
||||
|
||||
void "test consider dot-idea files out of project"() {
|
||||
def outside = addEmptyFile(".idea/workspace.xml")
|
||||
def inside = addEmptyFile("workspace.txt")
|
||||
|
||||
@@ -163,9 +163,11 @@ public class GotoFileItemProvider extends DefaultChooseByNameItemProvider {
|
||||
}
|
||||
|
||||
if (group.size() > 1) {
|
||||
//noinspection StringToUpperCaseOrToLowerCaseWithoutLocale
|
||||
Collections.sort(group,
|
||||
Comparator.<PsiFileSystemItem, Boolean>comparing(f -> f instanceof PsiDirectory).
|
||||
thenComparing(qualifierMatchingDegrees::get).
|
||||
thenComparing(i -> FileUtilRt.getNameWithoutExtension(i.getName()).toLowerCase()).
|
||||
thenComparing(i -> i.getName().toLowerCase()).
|
||||
thenComparing(nesting::get).
|
||||
thenComparing(dirCloseness::get).
|
||||
|
||||
Reference in New Issue
Block a user