Pass tool id to highlightInfo instead of group id

GitOrigin-RevId: ed5e0cc40cd0503afc6bb9b88e54d645caeb437d
This commit is contained in:
Vladimir Krasnotsvetov
2019-10-02 11:32:52 +00:00
committed by intellij-monorepo-bot
parent 8d77335ace
commit 89f90cb9e7
3 changed files with 14 additions and 14 deletions
@@ -74,7 +74,7 @@ public class HighlightInfo implements Segment {
private final HighlightSeverity severity;
private final GutterMark gutterIconRenderer;
private final ProblemGroup myProblemGroup;
private final String inspectionGroupKey;
private final String inspectionToolId;
private int group;
private int fixStartOffset;
@@ -143,8 +143,8 @@ public class HighlightInfo implements Segment {
}
@Nullable
public String getInspectionGroupKey() {
return inspectionGroupKey;
public String getInspectionToolId() {
return inspectionToolId;
}
private boolean isFlagSet(@FlagConstant byte mask) {
@@ -283,7 +283,7 @@ public class HighlightInfo implements Segment {
boolean isFileLevelAnnotation,
int navigationShift,
ProblemGroup problemGroup,
@Nullable String inspectionGroupKey,
@Nullable String inspectionToolId,
GutterMark gutterIconRenderer) {
if (startOffset < 0 || startOffset > endOffset) {
LOG.error("Incorrect highlightInfo bounds. description="+escapedDescription+"; startOffset="+startOffset+"; endOffset="+endOffset+";type="+type);
@@ -305,7 +305,7 @@ public class HighlightInfo implements Segment {
this.navigationShift = navigationShift;
myProblemGroup = problemGroup;
this.gutterIconRenderer = gutterIconRenderer;
this.inspectionGroupKey = inspectionGroupKey;
this.inspectionToolId = inspectionToolId;
}
private static boolean calcNeedUpdateOnTyping(@Nullable Boolean needsUpdateOnTyping, HighlightInfoType type) {
@@ -391,7 +391,7 @@ public class HighlightInfo implements Segment {
@NotNull Builder gutterIconRenderer(@NotNull GutterIconRenderer gutterIconRenderer);
@NotNull Builder problemGroup(@NotNull ProblemGroup problemGroup);
@NotNull Builder inspectionGroupKey(@Nullable String groupKey);
@NotNull Builder inspectionToolId(@NotNull String inspectionTool);
// only one allowed
@NotNull Builder description(@NotNull String description);
@@ -448,7 +448,7 @@ public class HighlightInfo implements Segment {
private GutterIconRenderer gutterIconRenderer;
private ProblemGroup problemGroup;
private String inspectionGroupKey;
private String inspectionToolId;
private PsiElement psiElement;
private B(@NotNull HighlightInfoType type) {
@@ -473,9 +473,9 @@ public class HighlightInfo implements Segment {
@NotNull
@Override
public Builder inspectionGroupKey(@Nullable String groupKey) {
assert this.inspectionGroupKey == null : "inspectionGroupKey already set";
this.inspectionGroupKey = groupKey;
public Builder inspectionToolId(@NotNull String inspectionToolId) {
assert this.inspectionToolId == null : "inspectionToolId already set";
this.inspectionToolId = inspectionToolId;
return this;
}
@@ -634,7 +634,7 @@ public class HighlightInfo implements Segment {
return new HighlightInfo(forcedTextAttributes, forcedTextAttributesKey, type, startOffset, endOffset, escapedDescription,
escapedToolTip, severity, isAfterEndOfLine, myNeedsUpdateOnTyping, isFileLevelAnnotation, navigationShift,
problemGroup, inspectionGroupKey, gutterIconRenderer);
problemGroup, inspectionToolId, gutterIconRenderer);
}
}
@@ -256,7 +256,7 @@ public class InjectedGeneralHighlightingPass extends GeneralHighlightingPass {
info.type, fixedTextRange.getStartOffset(),
fixedTextRange.getEndOffset(),
info.getDescription(), info.getToolTip(), info.type.getSeverity(null),
info.isAfterEndOfLine(), null, false, 0, info.getProblemGroup(), info.getInspectionGroupKey(), info.getGutterIconRenderer());
info.isAfterEndOfLine(), null, false, 0, info.getProblemGroup(), info.getInspectionToolId(), info.getGutterIconRenderer());
patched.setFromInjection(true);
outInfos.add(patched);
}
@@ -319,7 +319,7 @@ public class InjectedGeneralHighlightingPass extends GeneralHighlightingPass {
new HighlightInfo(info.forcedTextAttributes, info.forcedTextAttributesKey, info.type,
hostRange.getStartOffset(), hostRange.getEndOffset(),
info.getDescription(), info.getToolTip(), info.type.getSeverity(null), isAfterEndOfLine, null,
false, 0, info.getProblemGroup(), info.getInspectionGroupKey(), info.getGutterIconRenderer());
false, 0, info.getProblemGroup(), info.getInspectionToolId(), info.getGutterIconRenderer());
patched.setHint(info.hasHint());
if (info.quickFixActionRanges != null) {
@@ -403,7 +403,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
.range(psiElement, textRange.getStartOffset(), textRange.getEndOffset())
.description(message)
.severity(severity)
.inspectionGroupKey(tool.getGroupKey());
.inspectionToolId(tool.getID());
if (toolTip != null) b.escapedToolTip(toolTip);
if (HighlightSeverity.INFORMATION.equals(severity) && attributes == null && toolTip == null && !quickFixes.isEmpty()) {
// Hack to avoid filtering this info out in HighlightInfoFilterImpl even though its attributes are empty.