Download this extension from the VS Gallery or get the CI build.
A Visual Studio project template for creating code snippet packs targeting any supported language. The snippet pack will be an extension you can share with your team or upload to the Visual Studio extension gallery.
See the change log for changes and road map.
- Create snippet pack extensions
- Works with all supported languages like C#, VB, JavaScript, HTML etc.
- The snippet packs will work in Visual Studio 2012, 2013 and 2015.
Create a new project and select the Snippet Pack Extension.
That will create a VSIX project with the following structure:
Instructions will automatically show up on how to modify the snippets to your scenario.
Snippets are per language, and this snippet pack is targeting JavaScript by default. It is easy to change so you can target any other language supporting snippets.
To do that, open Snippets/snippets.pkgdef and follow the instructions found at the top of that file.
You can also have snippets for multiple languages. To do that, add an additional entry in the Snippets/snippets.pkgdef for the new language and add an additional folder with snippets targeting that language.
The Snippets folder contains a folder which has the name of your extension. You can name this folder whatever you want as long as you also change the name in snippets.pkgdef accordingly.
The .snippet must have a few properties set correctly for this to work.
Select one or more .snippet files and hit F4 to bring up the property grid. Set the following properties:
- Build action : Content
- Include in VSIX: True
Read more about the possibilities with code snippets on MSDN
Here are some of the snippet packs made by this template:
Check out the contribution guidelines if you want to contribute to this project.
For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.