mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-89114 Unsuitable completion proposals in annotation attribute value
This commit is contained in:
@@ -135,6 +135,7 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
and(JavaSmartCompletionContributor.INSIDE_EXPRESSION,
|
||||
not(psiElement().afterLeaf(PsiKeyword.CASE)),
|
||||
not(psiElement().afterLeaf(psiElement().withText(".").afterLeaf(PsiKeyword.THIS, PsiKeyword.SUPER))),
|
||||
not(psiElement().inside(PsiAnnotation.class)),
|
||||
not(START_SWITCH));
|
||||
|
||||
public static final AndFilter CLASS_START = new AndFilter(
|
||||
@@ -142,7 +143,8 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
END_OF_BLOCK,
|
||||
new PatternFilter(psiElement().afterLeaf(
|
||||
or(
|
||||
psiElement().withoutText(".").inside(psiElement(PsiModifierList.class).withParent(not(psiElement(PsiParameter.class)))),
|
||||
psiElement().withoutText(".").inside(psiElement(PsiModifierList.class).withParent(not(psiElement(PsiParameter.class)))).andNot(
|
||||
psiElement().inside(PsiAnnotationParameterList.class)),
|
||||
psiElement().isNull())))
|
||||
),
|
||||
new PatternFilter(not(psiElement().afterLeaf("@"))));
|
||||
@@ -486,8 +488,10 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
}
|
||||
|
||||
if (EXPR_KEYWORDS.accepts(position)) {
|
||||
result.addElement(TailTypeDecorator.withTail(createKeyword(position, PsiKeyword.NEW), TailType.INSERT_SPACE));
|
||||
result.addElement(createKeyword(position, PsiKeyword.NULL));
|
||||
if (PsiTreeUtil.getParentOfType(position, PsiAnnotation.class) == null) {
|
||||
result.addElement(TailTypeDecorator.withTail(createKeyword(position, PsiKeyword.NEW), TailType.INSERT_SPACE));
|
||||
result.addElement(createKeyword(position, PsiKeyword.NULL));
|
||||
}
|
||||
result.addElement(createKeyword(position, PsiKeyword.TRUE));
|
||||
result.addElement(createKeyword(position, PsiKeyword.FALSE));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user