IDEA-88106 Auto-completion works incorrectly when I make and then fix a mistake

This commit is contained in:
peter
2012-07-02 13:15:17 +02:00
parent 5cec1d3638
commit 5a5cb78e31
12 changed files with 61 additions and 29 deletions
@@ -1272,4 +1272,22 @@ class Foo {
myFixture.checkResult 'class Foo {{ boolean <caret> }}'
}
@Override
protected void tearDown() {
CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.FIRST_LETTER
super.tearDown()
}
public void testBackspaceShouldShowPreviousVariants() {
CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.NONE
myFixture.addClass("class OuterX { static class TrueLine {} }")
myFixture.configureByText 'a.java', 'class Foo{ void foo(int truex) { return tr<caret> }}'
type 'ue'
assert myFixture.lookupElementStrings == ['true', 'truex']
type 'l'
assert myFixture.lookupElementStrings == ['TrueLine']
type '\b'
assert myFixture.lookupElementStrings == ['true', 'truex']
}
}
@@ -63,7 +63,7 @@ public abstract class CompletionTestCase extends DaemonAnalyzerTestCase {
}
protected void complete(final int time) {
new CodeCompletionHandlerBase(myType).invokeCompletion(myProject, myEditor, time, false);
new CodeCompletionHandlerBase(myType).invokeCompletion(myProject, myEditor, time);
LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myEditor);
myItems = lookup == null ? null : lookup.getItems().toArray(new LookupElement[lookup.getItems().size()]);
@@ -57,7 +57,7 @@ public abstract class LightCompletionTestCase extends LightCodeInsightTestCase {
}
protected void complete(final int time) {
new CodeCompletionHandlerBase(myType).invokeCompletion(getProject(), getEditor(), time, false);
new CodeCompletionHandlerBase(myType).invokeCompletion(getProject(), getEditor(), time);
LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myEditor);
myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY);