mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-99523 "final" should be suggested after "case"
This commit is contained in:
@@ -416,7 +416,7 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
statement = PsiTreeUtil.getParentOfType(position, PsiDeclarationStatement.class);
|
||||
}
|
||||
if (statement != null && statement.getTextRange().getStartOffset() == position.getTextRange().getStartOffset()) {
|
||||
if (!psiElement().withSuperParent(2, PsiSwitchStatement.class).accepts(statement)) {
|
||||
if (!psiElement().withSuperParent(2, PsiSwitchStatement.class).afterLeaf("{").accepts(statement)) {
|
||||
result.addElement(new OverrideableSpace(createKeyword(position, PsiKeyword.FINAL), TailType.HUMBLE_SPACE_BEFORE_WORD));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
public class StructuredConfigKey {
|
||||
{
|
||||
switch (x) {
|
||||
case 2:
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
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 testFinalAfterCase() throws Exception { doTest(3, "final", "float", "class"); }
|
||||
public void testFinalInTryWithResources() throws Exception { doTest(1, "final", "float", "class"); }
|
||||
public void testClassInMethod() throws Exception { doTest(2, "class", "char"); }
|
||||
public void testIntInClassArray() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
|
||||
Reference in New Issue
Block a user