diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java b/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java index d7c353bb1afc..54ec3939ef54 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java @@ -19,6 +19,7 @@ import com.intellij.codeHighlighting.HighlightDisplayLevel; import com.intellij.codeInspection.GlobalInspectionContext; import com.intellij.codeInspection.InspectionEP; import com.intellij.codeInspection.InspectionProfileEntry; +import com.intellij.lang.Language; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; @@ -85,6 +86,10 @@ public abstract class InspectionToolWrapper getDialects() { return myDialects; } 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 c007bd230837..f77cb58cce7d 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 @@ -729,6 +729,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass List enabled = new ArrayList(); final InspectionToolWrapper[] toolWrappers = profile.getInspectionTools(element); InspectionProfileWrapper.checkInspectionsDuplicates(toolWrappers); + Language language = myFile.getLanguage(); for (InspectionToolWrapper toolWrapper : toolWrappers) { if (!profile.isToolEnabled(HighlightDisplayKey.find(toolWrapper.getShortName()), element)) continue; LocalInspectionToolWrapper wrapper = null; @@ -736,8 +737,10 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass wrapper = (LocalInspectionToolWrapper)toolWrapper; } if (wrapper == null) continue; - if (myIgnoreSuppressed && InspectionManagerEx.inspectionResultSuppressed(myFile, wrapper.getTool())) { - continue; + if (myIgnoreSuppressed) { + if (wrapper.isApplicable(language) && InspectionManagerEx.inspectionResultSuppressed(myFile, wrapper.getTool())) { + continue; + } } enabled.add(wrapper); }