mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
autopopup after dot
This commit is contained in:
@@ -985,6 +985,10 @@ public class JavaCompletionUtil {
|
||||
}
|
||||
}
|
||||
toInsert.processTail(editor, context.getTailOffset());
|
||||
|
||||
if (context.getCompletionChar() == '.') {
|
||||
AutoPopupController.getInstance(file.getProject()).autoPopupMemberLookup(context.getEditor(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.intellij.codeInsight.lookup;
|
||||
|
||||
import com.intellij.codeInsight.AutoPopupController;
|
||||
import com.intellij.codeInsight.TailType;
|
||||
import com.intellij.codeInsight.completion.InsertionContext;
|
||||
import com.intellij.psi.PsiSubstitutor;
|
||||
@@ -41,5 +42,9 @@ public class VariableLookupItem extends LookupItem<PsiVariable> implements Typed
|
||||
context.setAddCompletionChar(false);
|
||||
TailType.COMMA.processTail(context.getEditor(), context.getTailOffset());
|
||||
}
|
||||
else if (context.getCompletionChar() == '.') {
|
||||
AutoPopupController.getInstance(context.getProject()).autoPopupMemberLookup(context.getEditor(), null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,6 +344,26 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
|
||||
assert 'Thread' in myFixture.lookupElementStrings
|
||||
}
|
||||
|
||||
public void testDotAfterVariable() {
|
||||
myFixture.configureByText("a.java", """
|
||||
class A {
|
||||
{ Object ooo; <caret> }
|
||||
}
|
||||
""")
|
||||
type 'o.'
|
||||
assert myFixture.file.text.contains("ooo.")
|
||||
assert lookup
|
||||
}
|
||||
|
||||
public void testDotAfterCall() {
|
||||
myFixture.configureByText("a.java", """
|
||||
class A {
|
||||
{ <caret> }
|
||||
}
|
||||
""")
|
||||
type 'tos.'
|
||||
assert myFixture.file.text.contains("toString().")
|
||||
assert lookup
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user