mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
[java] don't show illegal static error in javadoc reference (IDEA-211302)
GitOrigin-RevId: 2f71fba18c8f61496fe6c6fbc2ea171d2adbafdd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1e23b24835
commit
cc41c3aec2
@@ -1195,7 +1195,10 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
place = ref;
|
||||
}
|
||||
}
|
||||
if (place != null && PsiTreeUtil.isAncestor(aClass, place, false) && aClass.hasTypeParameters()) {
|
||||
if (place != null &&
|
||||
PsiTreeUtil.isAncestor(aClass, place, false) &&
|
||||
aClass.hasTypeParameters() &&
|
||||
!PsiUtil.isInsideJavadocComment(place)) {
|
||||
myHolder.add(HighlightClassUtil.checkCreateInnerClassFromStaticContext(ref, place, (PsiClass)resolved));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.psi.util;
|
||||
|
||||
import com.intellij.core.JavaPsiBundle;
|
||||
@@ -870,7 +870,7 @@ public final class PsiUtil extends PsiUtilCore {
|
||||
}
|
||||
|
||||
public static boolean isInsideJavadocComment(PsiElement element) {
|
||||
return PsiTreeUtil.getParentOfType(element, PsiDocComment.class, true) != null;
|
||||
return PsiTreeUtil.getParentOfType(element, PsiDocComment.class, true, PsiMember.class) != null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -4,6 +4,10 @@ class MyTest<K> {
|
||||
}
|
||||
|
||||
//not an error in java 8?!
|
||||
|
||||
/**
|
||||
* {@link A}
|
||||
*/
|
||||
static class C<T extends <error descr="'MyTest.this' cannot be referenced from a static context">A<String></error>> {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user