mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
highlight suppressed places restored
This commit is contained in:
+10
-9
@@ -244,7 +244,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
indicator.checkCanceled();
|
||||
|
||||
myInfos = new ArrayList<HighlightInfo>();
|
||||
addHighlightsFromResults(myInfos);
|
||||
addHighlightsFromResults(myInfos, ignoreSuppressed);
|
||||
}
|
||||
|
||||
private void visitPriorityElementsAndInit(@NotNull List<LocalInspectionTool> tools,
|
||||
@@ -380,7 +380,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
public Collection<HighlightInfo> getHighlights() {
|
||||
List<HighlightInfo> highlights = new ArrayList<HighlightInfo>();
|
||||
|
||||
addHighlightsFromResults(highlights);
|
||||
addHighlightsFromResults(highlights, true);
|
||||
return highlights;
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
|
||||
private void addDescriptorIncrementally(@NotNull final ProblemDescriptor descriptor,
|
||||
@NotNull final LocalInspectionTool tool,
|
||||
boolean ignoreSuppressed,
|
||||
final boolean ignoreSuppressed,
|
||||
@NotNull final ProgressIndicator indicator) {
|
||||
if (ignoreSuppressed && InspectionManagerEx.inspectionResultSuppressed(descriptor.getPsiElement(), tool)) {
|
||||
return;
|
||||
@@ -440,7 +440,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
HighlightSeverity severity = inspectionProfile.getErrorLevel(HighlightDisplayKey.find(tool.getShortName()), file).getSeverity();
|
||||
|
||||
infos.clear();
|
||||
createHighlightsForDescriptor(infos, emptyActionRegistered, ilManager, file, thisDocument, tool, severity, descriptor);
|
||||
createHighlightsForDescriptor(infos, emptyActionRegistered, ilManager, file, thisDocument, tool, severity, descriptor, ignoreSuppressed);
|
||||
for (HighlightInfo info : infos) {
|
||||
final EditorColorsScheme colorsScheme = getColorsScheme();
|
||||
|
||||
@@ -508,7 +508,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
UpdateHighlightersUtil.setHighlightersToEditor(myProject, myDocument, myStartOffset, myEndOffset, myInfos, getColorsScheme(), getId());
|
||||
}
|
||||
|
||||
private void addHighlightsFromResults(final List<HighlightInfo> outInfos) {
|
||||
private void addHighlightsFromResults(final List<HighlightInfo> outInfos, boolean ignoreSuppressed) {
|
||||
InspectionProfile inspectionProfile = InspectionProjectProfileManager.getInstance(myProject).getInspectionProfile();
|
||||
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject);
|
||||
InjectedLanguageManager ilManager = InjectedLanguageManager.getInstance(myProject);
|
||||
@@ -523,7 +523,8 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
LocalInspectionTool tool = inspectionResult.tool;
|
||||
HighlightSeverity severity = inspectionProfile.getErrorLevel(HighlightDisplayKey.find(tool.getShortName()), file).getSeverity();
|
||||
for (ProblemDescriptor descriptor : inspectionResult.foundProblems) {
|
||||
createHighlightsForDescriptor(outInfos, emptyActionRegistered, ilManager, file, documentRange, tool, severity, descriptor);
|
||||
createHighlightsForDescriptor(outInfos, emptyActionRegistered, ilManager, file, documentRange, tool, severity, descriptor,
|
||||
ignoreSuppressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -536,10 +537,10 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
Document documentRange,
|
||||
LocalInspectionTool tool,
|
||||
HighlightSeverity severity,
|
||||
ProblemDescriptor descriptor) {
|
||||
ProblemDescriptor descriptor, boolean ignoreSuppressed) {
|
||||
PsiElement psiElement = descriptor.getPsiElement();
|
||||
if (psiElement == null) return;
|
||||
if (InspectionManagerEx.inspectionResultSuppressed(psiElement, tool)) return;
|
||||
if (ignoreSuppressed && InspectionManagerEx.inspectionResultSuppressed(psiElement, tool)) return;
|
||||
HighlightInfoType level = highlightTypeFromDescriptor(descriptor, severity);
|
||||
HighlightInfo info = createHighlightInfo(descriptor, tool, level, emptyActionRegistered);
|
||||
if (info == null) return;
|
||||
@@ -677,7 +678,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
}
|
||||
for (final LocalInspectionTool tool : tools) {
|
||||
indicator.checkCanceled();
|
||||
if (host != null && InspectionManagerEx.inspectionResultSuppressed(host, tool)) {
|
||||
if (host != null && ignoreSuppressed && InspectionManagerEx.inspectionResultSuppressed(host, tool)) {
|
||||
continue;
|
||||
}
|
||||
ProblemsHolder holder = new ProblemsHolder(iManager, injectedPsi, isOnTheFly) {
|
||||
|
||||
Reference in New Issue
Block a user