mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-88769 Java keyword completion: duplicate "final" suggestion
This commit is contained in:
@@ -538,11 +538,14 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (psiElement().afterLeaf(
|
||||
or(
|
||||
psiElement().withoutText(".").inside(psiElement(PsiModifierList.class).withParent(not(psiElement(PsiParameter.class)))).andNot(
|
||||
psiElement().inside(PsiAnnotationParameterList.class)),
|
||||
psiElement().isNull())).accepts(position)) {
|
||||
PsiElement prev = PsiTreeUtil.prevVisibleLeaf(position);
|
||||
if (prev == null) {
|
||||
return true;
|
||||
}
|
||||
if (psiElement().withoutText(".").inside(
|
||||
psiElement(PsiModifierList.class).withParent(
|
||||
not(psiElement(PsiParameter.class)).andNot(psiElement(PsiParameterList.class)))).accepts(prev) &&
|
||||
!psiElement().inside(PsiAnnotationParameterList.class).accepts(prev)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
public class Util {
|
||||
void foo(@Foo <caret> int args) { }
|
||||
}
|
||||
@@ -105,6 +105,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
public void testCharInAnnotatedParameter() throws Exception { doTest(1, "char"); }
|
||||
public void testReturnInTernary() throws Exception { doTest(1, "return"); }
|
||||
public void testFinalAfterParameterAnno() throws Exception { doTest(2, "final", "float", "class"); }
|
||||
public void testFinalAfterParameterAnno2() throws Exception { doTest(2, "final", "float", "class"); }
|
||||
public void testClassInMethod() throws Exception { doTest(2, "class", "char"); }
|
||||
public void testIntInClassArray() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInClassArray2() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
|
||||
Reference in New Issue
Block a user