mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
highlight enum constant name when its body should contain some implementation (IDEA-98411)
This commit is contained in:
+1
-1
@@ -244,7 +244,7 @@ public class HighlightNamesUtil {
|
||||
|
||||
public static TextRange getClassDeclarationTextRange(@NotNull PsiClass aClass) {
|
||||
if (aClass instanceof PsiEnumConstantInitializer) {
|
||||
return aClass.getLBrace().getTextRange();
|
||||
return ((PsiEnumConstantInitializer)aClass).getEnumConstant().getNameIdentifier().getTextRange();
|
||||
}
|
||||
final PsiElement psiElement = aClass instanceof PsiAnonymousClass
|
||||
? ((PsiAnonymousClass)aClass).getBaseClassReference()
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
<error descr="Modifier 'abstract' not allowed here">abstract</error> enum OurEnum {
|
||||
A <error descr="Class 'Anonymous class derived from OurEnum' must implement abstract method 'foo()' in 'OurEnum'">{</error>
|
||||
<error descr="Class 'Anonymous class derived from OurEnum' must implement abstract method 'foo()' in 'OurEnum'">A</error> {
|
||||
},
|
||||
<error descr="'OurEnum' is abstract; cannot be instantiated">B</error>,
|
||||
C {
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
enum xxx {
|
||||
<error descr="'xxx' is abstract; cannot be instantiated">X</error>,
|
||||
Y <error descr="Class 'Anonymous class derived from xxx' must implement abstract method 'f()' in 'xxx'">{</error>
|
||||
<error descr="Class 'Anonymous class derived from xxx' must implement abstract method 'f()' in 'xxx'">Y</error> {
|
||||
};
|
||||
|
||||
abstract void f();
|
||||
|
||||
Reference in New Issue
Block a user