InspectionSuppressor only receives elements of type KtFile
I am developing a plugin that ignores suppressions for a particular kind of Kotlin constructor.
I added a dependency `on org.jetbrains.kotlin` in the plugin.xml file, and have a class that implements com.intellij.codeInspection.InspectionSuppressor. The class is registered in plugin.xml:
<extensions defaultExtensionNs="com.intellij">
<lang.inspectionSuppressor language="kotlin" implementationClass="my.full.ClassName"/>
</extensions>
However, when I launch the plugin, the only kind of PsiElement my implementation ever receives is KtFile. Is there anything I'm missing?
Please sign in to leave a comment.
Added a breakpoint to spot where the calls to my implementation come from, seems they're all from:
Please try adding 'order="first"' to inspectionSuppressor registration in your plugin.xml
This did not seem to make any difference unfortunately.
My plugin.xml looks as follows:
My implementation:
Does any *enabled* inspection produce problems on given code snippet for you?
Hey Dmitry, sorry for the late reply. Just got back to this again.
Yes, inspection providers outside my plugin do, for instance the "Convert to primary constructor" one.
I changed the suppressor's language to UAST in plugin.xml, and receive all sorts of PsiElements from Java files, and was able to make it all work with Java.
Kotlin doesn't work however, as I still only get KtFile!