don't double register class symbol highlights

This commit is contained in:
Anna.Kozlova
2018-12-13 11:35:10 +01:00
parent 628bb38fe5
commit 2bb71bfc15
2 changed files with 0 additions and 17 deletions
@@ -172,19 +172,6 @@ public class HighlightNamesUtil {
: builder.create();
}
@Nullable
static HighlightInfo highlightClassNameInQualifier(@NotNull PsiJavaCodeReferenceElement element,
@NotNull TextAttributesScheme colorsScheme) {
PsiElement qualifierExpression = element.getQualifier();
if (qualifierExpression instanceof PsiJavaCodeReferenceElement) {
PsiElement resolved = ((PsiJavaCodeReferenceElement)qualifierExpression).resolve();
if (resolved instanceof PsiClass) {
return highlightClassName((PsiClass)resolved, qualifierExpression, colorsScheme);
}
}
return null;
}
private static HighlightInfoType getMethodNameHighlightType(@NotNull PsiMethod method,
boolean isDeclaration,
boolean isInheritedMethod,
@@ -751,7 +751,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
myHolder.add(HighlightNamesUtil.highlightClassName((PsiClass)resolved, ref, colorsScheme));
}
else {
myHolder.add(HighlightNamesUtil.highlightClassNameInQualifier(ref, colorsScheme));
if (referenceNameElement != null) {
if (resolved instanceof PsiVariable) {
myHolder.add(HighlightNamesUtil.highlightVariableName((PsiVariable)resolved, referenceNameElement, colorsScheme));
@@ -868,7 +867,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
PsiElement methodNameElement = element.getReferenceNameElement();
if (method != null && methodNameElement != null&& !(methodNameElement instanceof PsiKeyword)) {
myHolder.add(HighlightNamesUtil.highlightMethodName(method, methodNameElement, false, colorsScheme));
myHolder.add(HighlightNamesUtil.highlightClassNameInQualifier(element, colorsScheme));
}
}
else if (parent instanceof PsiConstructorCall) {
@@ -1146,7 +1144,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
myHolder.add(HighlightNamesUtil.highlightVariableName(variable, nameElement, colorsScheme));
}
}
myHolder.add(HighlightNamesUtil.highlightClassNameInQualifier(ref, colorsScheme));
}
else {
highlightReferencedMethodOrClassName(ref, resolved);
@@ -1353,7 +1350,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
myHolder.add(HighlightNamesUtil.highlightMethodName((PsiMethod)method, methodNameElement, false, colorsScheme));
}
}
myHolder.add(HighlightNamesUtil.highlightClassNameInQualifier(expression, colorsScheme));
}
if (!LambdaUtil.isValidLambdaContext(parent)) {