mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-221379 Unexpected "instanceof" keyword completion in annotation
GitOrigin-RevId: 8058445f8b789fecf63058a05b5db1aa0ce39eb1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
91c04c991f
commit
fc82e319c3
@@ -611,7 +611,8 @@ public class JavaKeywordCompletion {
|
||||
if (prev == null) return false;
|
||||
|
||||
PsiElement expr = PsiTreeUtil.getParentOfType(prev, PsiExpression.class);
|
||||
if (expr != null && expr.getTextRange().getEndOffset() == prev.getTextRange().getEndOffset()) {
|
||||
if (expr != null && expr.getTextRange().getEndOffset() == prev.getTextRange().getEndOffset() &&
|
||||
PsiTreeUtil.getParentOfType(expr, PsiAnnotation.class) == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
@Language("RegExp" <caret>x) String pattern;
|
||||
}
|
||||
+1
@@ -116,6 +116,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
public void testSpaceAfterInstanceof() { doTest(); }
|
||||
public void testInstanceofAfterUnresolved() { doTest(1, "instanceof"); }
|
||||
public void testInstanceofAfterStatementStart() { doTest(1, "instanceof"); }
|
||||
public void testNoInstanceofInAnnotation() { doTest(0, "instanceof"); }
|
||||
|
||||
public void testInstanceofNegation() {
|
||||
configureByTestName();
|
||||
|
||||
Reference in New Issue
Block a user