Use YAML in plugin

I'm trying to make an inspection that works on YAML files, but I don't really get how to do this. I read the IntelliJ Plugin Extension page, but I can't seem to get it to work. This is what I've currently got:

<extensions defaultExtensionNs="org.jetbrains.plugins.yaml">
</extensions>

Now I'm supposed to add a reference to an extension point in here, but I can't seem to find one. I looked over at the GitHub page, but the plugin.xml file seems to have no extension points declared. So, is it even possible to make use of the YAML plugin? Or am I doing it completely wrong?

0
2 comments

Hi Stefvanschiedev,

You don't need to look for particular YAML plugin extension points. The easiest way to implement and add an inspection is to refer to the 

com.intellij.localInspection

extensionPoint. The implementation class should extend `com.intellij.codeInspection.LocalInspectionTool`, it has some javadoc. To register you extension, you'll also need to define attributes like 

language="YAML" 
shortName="MyNewInspection"
displayName="Check YAML files for strange places"
groupName="YAML inspections"
enabledByDefault="true"
level="INFORMATION"
implementationClass="a.b.c.MyInspection"

Please tell me if you have any further questions.

Regards,
Valentin.

0
Avatar
Permanently deleted user

Thank you Valentin Fondaratov, that solved my issue.

0

Please sign in to leave a comment.