[java-highlighting] IDEA-264182 Do not report 'Annotations are not allowed here' in unterminated parameter list

GitOrigin-RevId: 6c6aff57643ec10b1ba2c44b52e6db352d43513a
This commit is contained in:
Tagir Valeev
2021-03-12 19:13:45 +07:00
committed by intellij-monorepo-bot
parent 99c6375d04
commit 7a0831408f
2 changed files with 6 additions and 1 deletions

View File

@@ -335,7 +335,9 @@ public final class AnnotationsHighlightUtil {
psiElement().withParent(PsiNameValuePair.class),
psiElement().withParents(PsiArrayInitializerMemberValue.class, PsiNameValuePair.class),
psiElement().withParents(PsiArrayInitializerMemberValue.class, PsiAnnotationMethod.class),
psiElement().withParent(PsiAnnotationMethod.class).afterLeaf(PsiKeyword.DEFAULT)
psiElement().withParent(PsiAnnotationMethod.class).afterLeaf(PsiKeyword.DEFAULT),
// Unterminated parameter list like "void test(@NotNull String)": error on annotation looks annoying here
psiElement().withParents(PsiModifierList.class, PsiParameterList.class)
);
public static HighlightInfo checkApplicability(@NotNull PsiAnnotation annotation, @NotNull LanguageLevel level, @NotNull PsiFile file) {

View File

@@ -13,6 +13,9 @@ abstract class C {
@Anno(nested = {@Anno, @Anno})
void notWrong() { }
void test(@Anno String<error descr="Identifier expected">)</error> {
}
}
class B extends <error descr="Type annotations are not supported at language level '7'">@Deprecated</error> Object { }