cleanup: simplify range() calls

GitOrigin-RevId: c13f8d89a0bf271f2eb37dd0bfe276a2e7cd68df
This commit is contained in:
Alexey Kudravtsev
2019-12-25 11:11:41 +00:00
committed by intellij-monorepo-bot
parent 6d730047f5
commit f257538ca1
4 changed files with 5 additions and 5 deletions
@@ -515,7 +515,7 @@ public class AnnotationsHighlightUtil {
PsiModifierList annotationList = statement.getAnnotationList();
if (annotationList != null && !PsiPackage.PACKAGE_INFO_FILE.equals(file.getName())) {
String message = JavaErrorMessages.message("invalid.package.annotation.containing.file");
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(annotationList.getTextRange()).descriptionAndTooltip(message).create();
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(annotationList).descriptionAndTooltip(message).create();
}
return null;
}
@@ -899,7 +899,7 @@ public class GenericsHighlightUtil {
for (PsiJavaCodeReferenceElement referenceElement : typeParameter1.getExtendsList().getReferenceElements()) {
final PsiElement resolve = referenceElement.resolve();
if (resolve instanceof PsiTypeParameter && ArrayUtilRt.find(parameters, resolve) > i) {
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(referenceElement.getTextRange()).descriptionAndTooltip("Illegal forward reference").create();
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(referenceElement).descriptionAndTooltip("Illegal forward reference").create();
}
}
}
@@ -1488,7 +1488,7 @@ public class GenericsHighlightUtil {
if (message != null) {
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
.descriptionAndTooltip(message)
.range(ref.getTextRange())
.range(ref)
.create();
}
@@ -629,7 +629,7 @@ public class HighlightControlFlowUtil {
final String name = variable.getName();
String description = JavaErrorMessages.message("assignment.to.final.variable", name);
final HighlightInfo highlightInfo =
HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(reference.getTextRange()).descriptionAndTooltip(description).create();
HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(reference).descriptionAndTooltip(description).create();
final PsiElement innerClass = getInnerClassVariableReferencedFrom(variable, expression);
if (innerClass == null || variable instanceof PsiField) {
HighlightFixUtil.registerMakeNotFinalAction(variable, highlightInfo);
@@ -159,7 +159,7 @@ public class HighlightNamesUtil {
}
if (variable instanceof PsiField) {
TextAttributes attributes = mergeWithScopeAttributes(variable, varType, colorsScheme);
HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(varType).range(elementToHighlight.getTextRange());
HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(varType).range(elementToHighlight);
if (attributes != null) {
builder.textAttributes(attributes);
}