mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-183481 final keyword is wrongly auto-completed to finalize() in try-with-resources
This commit is contained in:
@@ -674,7 +674,7 @@ public class JavaKeywordCompletion {
|
||||
if (parent instanceof PsiVariable) parent = parent.getParent();
|
||||
return parent instanceof PsiCatchSection || parent instanceof PsiResourceList;
|
||||
}
|
||||
return false;
|
||||
return psiElement().insideStarting(psiElement(PsiResourceExpression.class)).accepts(position);
|
||||
}
|
||||
|
||||
private void addBreakContinue() {
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
public void testFinalInCatch() { doTest(1, "final"); }
|
||||
public void testFinalInIncompleteCatch() { doTest(1, "final"); }
|
||||
public void testFinalInCompleteCatch() { doTest(1, "final"); }
|
||||
public void testFinalInTryWithResources() { doTest(1, "final", "float", "class"); }
|
||||
public void testFinalInTryWithResources() { doTest(1, "final", "class"); }
|
||||
public void testFinalInCompleteTryWithResources() { doTest(1, "final", "float", "class"); }
|
||||
public void testFinalInLambda() { doTest(2, "final", "float"); }
|
||||
public void testNoFinalAfterTryBody() { doTest(1, "final", "finally"); }
|
||||
|
||||
Reference in New Issue
Block a user