Skip to content

Commit 9078d27

Browse files
committed
fix(inspections): don't run inspections on injected code in doc comment
Fixes #73
1 parent 98dfebc commit 9078d27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/kotlin/org/tonstudio/tact/ide/inspections/TactBaseInspection.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.tonstudio.tact.ide.inspections
22

33
import com.intellij.codeInspection.*
4+
import com.intellij.lang.injection.InjectedLanguageManager
45
import com.intellij.psi.PsiElement
56
import com.intellij.psi.PsiFile
67

@@ -11,6 +12,12 @@ abstract class TactBaseInspection : LocalInspectionTool(), CustomSuppressableIns
1112
// don't check node_modules
1213
return false
1314
}
15+
16+
val isInjected = InjectedLanguageManager.getInstance(file.project).isInjectedFragment(file)
17+
if (isInjected) {
18+
// don't check doc comments
19+
return false
20+
}
1421
return super.isAvailableForFile(file)
1522
}
1623
override fun getSuppressActions(element: PsiElement?): Array<SuppressIntentionAction?> {

0 commit comments

Comments
 (0)