Plugin suggestion for XML files

Answered

Hey,

my plugin adds features for a certain framework that is heavily using XML files to serialize database content. The plugin adds certain features to these XML files (language injection, completion, etc).

I'd like to have my plugin suggested now when an IntelliJ user opens one of these XML files. What would be the best way to achieve this?

I was thinking of creating a new file type based on the XML file type, but I do not always know the XML files' names and I'm not sure if I can apply the file type based on the XML content.

Cheers, Victor

0
3 comments

Thanks Yann,

I do know the most common filenames, so could I potentially do something like this to have my plugin suggested?

<fileType
fieldName="INSTANCE"
fileNames="content.xml"
implementationClass="com.intellij.ide.highlighter.XmlFileType"
name="XML"/>

Or would I have to implement my own XmlLikeFileType (unfortunately, XmlFileType is final)?

0

`<fileType name="XML" fileNames="content.xml"/>` should work (when feature is approved by JetBrains Marketplace)

0

Please sign in to leave a comment.