diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java b/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java index f0ef543e06b2..ad6d0285cd23 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java @@ -41,7 +41,9 @@ public enum ProblemHighlightType { /** Enforces {@link com.intellij.codeHighlighting.HighlightDisplayLevel#WEAK_WARNING} severity level */ WEAK_WARNING, - /** Enforces {@link com.intellij.codeHighlighting.HighlightDisplayLevel#DO_NOT_SHOW} severity level */ + /** Enforces {@link com.intellij.codeHighlighting.HighlightDisplayLevel#DO_NOT_SHOW} severity level + * Please ensure that if used from inspection explicitly, corresponding problem is added in the onTheFly mode only + */ INFORMATION, /** JEP 277 enhanced deprecation */ diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java index 182fd9cd3c1a..2460990c9e08 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java @@ -134,12 +134,21 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass @NotNull final List toolWrappers) { final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator(); inspect(new ArrayList<>(toolWrappers), iManager, false, false, progress); + boolean isSingleToolRun = context.getCurrentProfile().getSingleTool() != null; addDescriptorsFromInjectedResults(iManager, context); List resultList = result.get(getFile()); if (resultList == null) return; + Set toolsWithInformationInBatch = new HashSet<>(); for (InspectionResult inspectionResult : resultList) { LocalInspectionToolWrapper toolWrapper = inspectionResult.tool; + final String shortName = toolWrapper.getShortName(); for (ProblemDescriptor descriptor : inspectionResult.foundProblems) { + if (!isSingleToolRun && + descriptor.getHighlightType() == ProblemHighlightType.INFORMATION && + toolsWithInformationInBatch.add(shortName)) { + LOG.error("Tool '" + shortName + "' registers INFORMATION level problem in batch mode, " + + "though warning or level is used in user's settings"); + } addDescriptors(toolWrapper, descriptor, context); } }