visual-studiotextmatebundles

adding a new textmate grammar to visual studio 2015 update 1


In the visual studio 2015 update 1 release blog post (https://blogs.msdn.microsoft.com/visualstudio/2015/11/30/visual-studio-update-1-rtm/) the ability to add textmate bundles (or grammars) is explicitly mentioned:

Editor support for new languages. The Visual Studio editor now provides built-in syntax highlighting and basic IntelliSense support for languages including Go, Java, Perl, R, Ruby, and Swift. We support the TextMate bundle model for language grammars and snippets, allowing you to extend this with support for other languages.

I want to create a new textmate grammar for my own language, but I cannot find any documentation, how to do this in vs2015 update 1.

The best source I found is this reddit conversation: https://www.reddit.com/r/programming/comments/3uvwn3/visual_studio_2015_update_1/

It looks like it's implemented as an extension, "Visual Studio Extension for Textmate Grammars." If you search for *.tmbundle in your visual studio\Common7\IDE\Extensions directory you will find the location of the tmbundles. I just made a new folder for Julia and copied the Julia tmbundle to it. Seems to work.

Is this the supported way of doing this? Why isn't there any documentation, visual studio menu etc. for this?


Solution

  • You can do this the way you've done it above, or if you prefer it to be in your user profile directory rather than across the whole operating system installation, you can add the bundle here:

    %USERPROFILE%\.vs\Extensions\
    

    On most machines, that path expands to:

    C:\User\<yourusername>\.vs\Extensions\