mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Field names formatting in highlighting made independent of pesky plugins
This commit is contained in:
@@ -650,6 +650,11 @@ public class HighlightUtil {
|
||||
PsiFormatUtilBase.SHOW_TYPE);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String formatField(@NotNull PsiField field) {
|
||||
return PsiFormatUtil.formatVariable(field, PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME, PsiSubstitutor.EMPTY);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String formatType(@Nullable PsiType type) {
|
||||
if (type == null) return PsiKeyword.NULL;
|
||||
@@ -2150,6 +2155,7 @@ public class HighlightUtil {
|
||||
private static String format(PsiElement element) {
|
||||
if (element instanceof PsiClass) return formatClass((PsiClass)element);
|
||||
if (element instanceof PsiMethod) return formatMethod((PsiMethod)element);
|
||||
if (element instanceof PsiField) return formatField((PsiField)element);
|
||||
return ElementDescriptionUtil.getElementDescription(element, HighlightUsagesDescriptionLocation.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ class Usage {
|
||||
m(Base1.F); //Base1.m(int)
|
||||
m(F); //Base2.m(float), float Base2.F
|
||||
F.class.getName(); // class Base2.F
|
||||
m(<error descr="Reference to 'IF' is ambiguous, both 'field I1.IF' and 'field I2.IF' match">IF</error>);
|
||||
m(<error descr="Reference to 'IF' is ambiguous, both 'I1.IF' and 'I2.IF' match">IF</error>);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user