filter out inspections, suppressed for file
authoranna <Anna.Kozlova@jetbrains.com>
Thu, 19 Jan 2012 14:25:44 +0000 (15:25 +0100)
committeranna <Anna.Kozlova@jetbrains.com>
Thu, 19 Jan 2012 14:59:59 +0000 (15:59 +0100)
java/java-impl/src/com/intellij/codeInspection/SuppressManagerImpl.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java

index c0c3b5daf24d7c97fd851e40ad37a7a07f2769fd..fa83649ba458efb45910c953dec79fee396f16ce 100644 (file)
@@ -161,6 +161,7 @@ public class SuppressManagerImpl extends SuppressManager {
 
   @Nullable
   public PsiElement getElementToolSuppressedIn(@NotNull final PsiElement place, final String toolId) {
+    if (place instanceof PsiFile) return null;
     return ApplicationManager.getApplication().runReadAction(new Computable<PsiElement>() {
       @Nullable
       public PsiElement compute() {
index 8af705b6714371cf12f8eff834ba634dbf602329..fd2e12e5f23a67b6365eb32ca41318821e802b0b 100644 (file)
@@ -711,7 +711,14 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
   }
 
   List<LocalInspectionToolWrapper> getInspectionTools(InspectionProfileWrapper profile) {
-    return profile.getHighlightingLocalInspectionTools(myFile);
+    final List<LocalInspectionToolWrapper> tools = profile.getHighlightingLocalInspectionTools(myFile);
+    for (Iterator<LocalInspectionToolWrapper> iterator = tools.iterator(); iterator.hasNext(); ) {
+      LocalInspectionToolWrapper tool = iterator.next();
+      if (myIgnoreSuppressed && InspectionManagerEx.inspectionResultSuppressed(myFile, tool.getTool())) {
+        iterator.remove();
+      }
+    }
+    return tools;
   }
 
   private void doInspectInjectedPsi(@NotNull PsiFile injectedPsi,