mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
disable completion after enum constant (IDEA-199935)
This commit is contained in:
+8
-2
@@ -98,6 +98,8 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
psiElement().withText("}").withParent(
|
||||
psiElement(PsiCodeBlock.class).afterLeaf(PsiKeyword.TRY)));
|
||||
private static final ElementPattern<PsiElement> INSIDE_CONSTRUCTOR = psiElement().inside(psiMethod().constructor(true));
|
||||
private static final ElementPattern<PsiElement> AFTER_ENUM_CONSTANT =
|
||||
psiElement().inside(PsiTypeElement.class).afterLeaf(psiElement().inside(true, psiElement(PsiEnumConstant.class), psiClass()));
|
||||
|
||||
@Nullable
|
||||
public static ElementFilter getReferenceFilter(PsiElement position) {
|
||||
@@ -219,7 +221,9 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AFTER_NUMBER_LITERAL.accepts(position) || UNEXPECTED_REFERENCE_AFTER_DOT.accepts(position)) {
|
||||
if (AFTER_NUMBER_LITERAL.accepts(position) ||
|
||||
UNEXPECTED_REFERENCE_AFTER_DOT.accepts(position) ||
|
||||
AFTER_ENUM_CONSTANT.accepts(position)) {
|
||||
_result.stopHere();
|
||||
return;
|
||||
}
|
||||
@@ -512,7 +516,9 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
boolean isSecondCompletion = parameters.getInvocationCount() >= 2;
|
||||
|
||||
PsiElement position = parameters.getPosition();
|
||||
if (JavaKeywordCompletion.isInstanceofPlace(position) || JavaMemberNameCompletionContributor.INSIDE_TYPE_PARAMS_PATTERN.accepts(position)) {
|
||||
if (JavaKeywordCompletion.isInstanceofPlace(position) ||
|
||||
JavaMemberNameCompletionContributor.INSIDE_TYPE_PARAMS_PATTERN.accepts(position) ||
|
||||
AFTER_ENUM_CONSTANT.accepts(position)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
enum MarkerType {
|
||||
QUERY, SYNONYM, CLASS_ALIAS, NAMED_QUERY
|
||||
|
||||
s<caret>
|
||||
}
|
||||
+2
@@ -1869,4 +1869,6 @@ class Abc {
|
||||
myFixture.checkResult 'class Foo<T> { Foo<List<String>><caret> }'
|
||||
}
|
||||
|
||||
void testNoSuggestionsAfterEnumConstant() { doAntiTest() }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user