File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
src/org/jetbrains/vuejs/inspections Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 8282 implementationClass =" org.jetbrains.vuejs.lang.html.highlighting.VueSyntaxHighlighterFactory" />
8383
8484 <xml .xmlExtension implementation =" org.jetbrains.vuejs.codeInsight.VueXmlExtension" order =" before web-symbols-react" />
85+ <xml .xmlSuppressionProvider implementation =" org.jetbrains.vuejs.inspections.VueXmlSuppressionProvider" order =" first" />
8586 <html .embeddedContentSupport implementation =" org.jetbrains.vuejs.lang.html.lexer.VueEmbeddedContentSupport" />
8687 <html .embeddedContentSupport implementation =" org.jetbrains.vuejs.libraries.i18n.VueI18nEmbeddedContentSupport" />
8788 <notificationGroup displayType =" BALLOON" id =" Vue" isLogByDefault =" true"
Original file line number Diff line number Diff line change 1+ // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ package org.jetbrains.vuejs.inspections
3+
4+ import com.intellij.codeInspection.DefaultXmlSuppressionProvider
5+ import com.intellij.codeInspection.InspectionProfileEntry
6+ import com.intellij.psi.PsiElement
7+ import com.intellij.psi.PsiFile
8+ import com.intellij.xml.util.XmlDuplicatedIdInspection
9+ import com.intellij.xml.util.XmlInvalidIdInspection
10+ import org.jetbrains.vuejs.lang.html.VueLanguage
11+
12+ class VueXmlSuppressionProvider : DefaultXmlSuppressionProvider () {
13+
14+ companion object {
15+ val suppressedToolIds = listOf (
16+ XmlInvalidIdInspection ::class , XmlDuplicatedIdInspection ::class
17+ ).map { InspectionProfileEntry .getShortName(it.java.simpleName) }
18+ }
19+
20+ override fun isProviderAvailable (file : PsiFile ): Boolean = file.language.isKindOf(VueLanguage .INSTANCE )
21+
22+ override fun isSuppressedFor (element : PsiElement , inspectionId : String ): Boolean {
23+ return if (suppressedToolIds.contains(inspectionId)) true else super .isSuppressedFor(element, inspectionId)
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments