jlahoda commented on issue #1045: Support for TextMate grammars (from VS Code) URL: https://github.com/apache/incubator-netbeans/pull/1045#issuecomment-444667275 The current steps are roughly: -(in a NetBeans module), create a new file type: New/Other/Module Development/File Type pick a mime type, presumably "text/<second-part>". -then add an XML Layer: New/Other/Module Development/XML Layer next to the XML layer, copy the TextMate grammar and edit the layer like this: ``` <filesystem> <folder name="Editors"> <folder name="text"> <folder name="<second-part>"> <file name="<grammar-name>" url="<grammar-name>"> <attr name="textmate-grammar" stringvalue="<scopeName-from-the-grammar>" /> </file> </folder> </folder> </folder> </filesystem> ``` Filling: <second-part> from text/<second-part>, <grammar-name> with the filename of the grammar and <scopeName-from-the-grammar> with the value of the "scopeName" from the top-level of the grammar. -run the module (F6) - with a little luck, the IDE could syntax-highlight files with the given extensions using the grammar. I'd be intrigued to hear any experiences with this. There are some opportunities for simplification (instead of manually creating a layer, there could be an annotation on the DataObject which would generate the layer automatically, and then this could be (an optional) part of the wizard).
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
