redundant suppression: don't warn on "all" locally as global tools are not run (IDEA-253244)

GitOrigin-RevId: 3666dcf887e8a4735dee08f16e172c9272bfca24
This commit is contained in:
Anna Kozlova
2020-10-20 12:24:21 +02:00
committed by intellij-monorepo-bot
parent 017a58c542
commit 64cb6979ca
2 changed files with 1 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
// "Remove 'ALL' suppression" "true"
// "Remove 'ALL' suppression" "false"
import java.util.*;
@SuppressWarnings({"AL<caret>L"})

View File

@@ -9,7 +9,6 @@ import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel;
import com.intellij.lang.Language;
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
@@ -335,16 +334,6 @@ public class RedundantSuppressInspection extends GlobalSimpleInspectionTool {
HashMap<PsiElement, Collection<String>> scopes = new HashMap<>();
boolean suppressAll = collectSuppressions(element, scopes, IGNORE_ALL, mySuppressor);
if (suppressAll) {
for (String suppressId : myActiveTools) {
if (isSuppressedFor(element, suppressId, myToolToSuppressScopes.get(suppressId))) {
return;
}
}
TextRange range = mySuppressor.getHighlightingRange(element, SuppressionUtil.ALL);
String allSuppression = range.substring(element.getText());
holder.registerProblem(element, range,
InspectionsBundle.message("inspection.redundant.suppression.description"),
mySuppressor.createRemoveRedundantSuppressionFix(allSuppression));
return;
}
Collection<String> suppressIds = scopes.get(element);