mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup: simplify range() calls
GitOrigin-RevId: c13f8d89a0bf271f2eb37dd0bfe276a2e7cd68df
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6d730047f5
commit
f257538ca1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user