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
Please sign in to leave a comment.
Matching by file type works only by name/extension https://plugins.jetbrains.com/docs/marketplace/intellij-plugin-recommendations.html#7e7d93c0.
There's a feature request to allow detection by used namespaces https://youtrack.jetbrains.com/issue/IDEA-286357/Add-a-capability-to-promote-marketplace-plugins-for-well-known-XML-namespaces.
Thanks Yann,
I do know the most common filenames, so could I potentially do something like this to have my plugin suggested?
Or would I have to implement my own XmlLikeFileType (unfortunately, XmlFileType is final)?
`<fileType name="XML" fileNames="content.xml"/>` should work (when feature is approved by JetBrains Marketplace)