List<SuppressIntentionAction> (LocalInspectionTool inspection, final boolean isXPath) { final List<SuppressIntentionAction> actions = new ArrayList<>(4); actions.add(new SuppressInspectionAction(inspection.getID(), XPathBundle.message("intention.name.suppress.for.instruction")) { @Override protected XmlTag getAnchor(@NotNull PsiElement element) { return PsiTreeUtil.getContextOfType(element, XmlTag.class, isXPath); } }); actions.add(new SuppressInspectionAction(inspection.getID(), XPathBundle.message("intention.name.suppress.for.template")) { @Override protected XmlTag getAnchor(@NotNull PsiElement element) { return XsltCodeInsightUtil.getTemplateTag(element, isXPath); } }); actions.add(new SuppressInspectionAction(inspection.getID(), XPathBundle.message("intention.name.suppress.for.stylesheet")) { @Override protected XmlTag getAnchor(@NotNull PsiElement element) { final XmlDocument document = PsiTreeUtil.getContextOfType(element, XmlDocument.class, isXPath); return document != null ? document.getRootTag() : null; } }); actions.add(new SuppressInspectionAction(ALL_ID, XPathBundle.message("intention.name.suppress.all.for.stylesheet")) { @Override protected XmlTag getAnchor(@NotNull PsiElement element) { final XmlDocument document = PsiTreeUtil.getContextOfType(element, XmlDocument.class, isXPath); return document != null ? document.getRootTag() : null; } }); return actions; }