items that are prefixes of other items should go first

Java expected type also should go first, and win
current class should be preferred in completion (IDEA-64703)
This commit is contained in:
peter
2011-02-14 21:21:32 +01:00
parent 67042244dd
commit ec40eab2f2
14 changed files with 201 additions and 32 deletions

View File

@@ -71,7 +71,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
final int old = CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE;
try {
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = CodeInsightSettings.FIRST_LETTER;
checkPreferredItems(0, "classLoader", "classBeforeLoader", "clone", "class");
checkPreferredItems(0, "classLoader", "class", "classBeforeLoader", "clone");
}
finally {
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = old;
@@ -111,7 +111,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
public void testDispreferImpls() throws Throwable {
myFixture.addClass("package foo; public class Xxx {}");
checkPreferredItems(0, "Xxy", "Xxx", "XxxEx", "XxxImpl");
checkPreferredItems(0, "Xxx", "XxxEx", "XxxImpl", "Xxy");
}
public void testPreferOwnInnerClasses() throws Throwable {
@@ -130,7 +130,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
public void testPreferLessHumps() throws Throwable {
myFixture.addClass("package foo; public interface XaYa {}");
myFixture.addClass("package foo; public interface XyYa {}");
checkPreferredItems(0, "XaYa", "XyYa", "XaYaEx", "XaYaImpl", "XyYaXa");
checkPreferredItems(0, "XaYa", "XaYaEx", "XaYaImpl", "XyYa", "XyYaXa");
}
public void testPreferLessParameters() throws Throwable {
@@ -178,7 +178,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
checkPreferredItems(0, "value");
}
public void _testCurrentClassBest() {
public void testCurrentClassBest() {
checkPreferredItems(0, "XcodeProjectTemplate", "XcodeConfigurable");
}