honor completion-case-sensitive=ALL option in the new matcher

This commit is contained in:
peter
2011-03-30 20:29:08 +02:00
parent 20b21de476
commit d231d788c8
5 changed files with 49 additions and 17 deletions
@@ -0,0 +1,9 @@
class Foo {
{
Object classLOSomething;
Object classLoader;
Object classLoader2;
cLo<caret>
}
}
@@ -5,6 +5,7 @@
package com.intellij.codeInsight.completion;
import com.intellij.JavaTestUtil;
import com.intellij.codeInsight.CodeInsightSettings;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.impl.LookupImpl;
import com.intellij.psi.PsiClass;
@@ -59,6 +60,17 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
assertPreferredItems(0, "p", "pre", "param");
}
public void testUppercaseMatters2() throws Throwable {
final int old = CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE;
try {
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = CodeInsightSettings.ALL;
checkPreferredItems(0, "classLoader", "classLoader2");
}
finally {
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = old;
}
}
public void testShorterShouldBePreselected() throws Throwable {
checkPreferredItems(0, "foo", "fooLongButOfDefaultType");
}