Working with Extension Snippets
This guide explains how to work with snippets from VS Code extensions using SnippetStudio.
What are Extension Snippets?
Extension snippets are code snippets provided by VS Code extensions. Unlike user snippets (which you create yourself), extension snippets are bundled with extensions and provide pre-built code templates for various programming languages and frameworks.
To learn more about snippet-based extensions, see the VS Code documentation on installing or creating snippet extensions.
Export All Snippets from an Extension
SnippetStudio allows you to export all snippets from an installed extension at once:
- Open the Location Manager view from the Activity Bar
- Navigate to the Extensions section
- Locate the extension snippet file containing the snippets you want to export
- Select "Extract Snippets to a new file"
- Choose a filename
- Choose a destination folder for the exported snippets
- All snippets from that file will be saved as a
.code-snippets
file.
Use Case: This is useful when you want to:
- Use extension snippets without having the extension installed
- Modify extension snippets for personal use
- Create a backup of extension snippets
- Share snippets from an extension with your team
Export a Single Snippet from an Extension
To export just one specific snippet from an extension:
- Open the Snippets view
- Open a file of a language that you have extension snippets installed
- Expand the extension in the Extensions section
- Browse through the available snippets
- Click to edit a copy of a snippet
- Select a file to export the snippet to
- Edit the snippet like normal
Note: This won't edit the snippet in the extension itself, but will only make a copy
Use Case: This is ideal when you:
- Only need one or two snippets from a large extension
- Want to customize a specific snippet without affecting others
Hide Extension Snippets
You can disable these features. Click on the to edit extension settings, then set snippetstudio.view.showExtensions
to false
.
Use Case: Hide extension snippets when:
- You want to simplify the snippet and location manager view
- You want a slight increase in performance. The extension won't scan installed extensions for snippets at all, reducing background fileIO operations
Troubleshooting
Q: I can't see any extension snippets
- Make sure you have extensions with snippets installed
- Check if
snippetstudio.view.showExtensions
is enabled in settings - You must have at least one custom snippet file created for snippets to appear in the locations manager view
- Snippets won't appear if the extension didn't use properly formatted JSON.
Q: Export is not working
- Check if the extension snippets are properly formatted
- Try exporting to a different location
Q: Extension snippets still appear after disabling
- Hit the refresh button
- Verify your settings.json configuration