mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
apply start-matching case-insensitively whatever the completion matching option is
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
public class Foo {
|
||||
|
||||
Zoo foo() {
|
||||
return r<caret>
|
||||
}
|
||||
|
||||
void rMethod() {}
|
||||
}
|
||||
|
||||
enum Zoo {
|
||||
LEFT, RIGHT
|
||||
}
|
||||
+10
-2
@@ -98,11 +98,11 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
}
|
||||
|
||||
public void testDispreferDeclared() throws Throwable {
|
||||
checkPreferredItems(0, "aabbb", "aaa");
|
||||
checkPreferredItems(0, "aabbb", "Aaaaaaa", "aaa");
|
||||
}
|
||||
|
||||
public void testDispreferDeclaredOfExpectedType() throws Throwable {
|
||||
checkPreferredItems(0, "aabbb", "aaa");
|
||||
checkPreferredItems(0, "aabbb", "Aaaaaaa", "aaa");
|
||||
}
|
||||
|
||||
public void testDispreferImpls() throws Throwable {
|
||||
@@ -596,4 +596,12 @@ import java.lang.annotation.Target;
|
||||
assertPreferredItems 0, 'setText', 'setOurText'
|
||||
}
|
||||
|
||||
public void testEnumConstantStartMatching() {
|
||||
checkPreferredItems(0, 'rMethod', 'Zoo.RIGHT')
|
||||
myFixture.type('i\n;\nreturn r')
|
||||
myFixture.completeBasic()
|
||||
assertPreferredItems 0, 'Zoo.RIGHT', 'rMethod'
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,12 +43,6 @@ public class CamelHumpMatcher extends PrefixMatcher {
|
||||
|
||||
@Override
|
||||
public boolean isStartMatch(LookupElement element) {
|
||||
if (super.isStartMatch(element)) {
|
||||
return true;
|
||||
}
|
||||
if (element.isCaseSensitive()) {
|
||||
return false;
|
||||
}
|
||||
return ContainerUtil.or(element.getAllLookupStrings(), new Condition<String>() {
|
||||
@Override
|
||||
public boolean value(String s) {
|
||||
|
||||
Reference in New Issue
Block a user