Finding Saved Snippets
In Visual Studio, you can locate your snippets in two main ways.
via Pieces Sidebar
To locate your snippets, use the Pieces Sidebar menu or the search feature:
**via Right-Click Menu**
Right-click in your editor window, hover over `Pieces`, and select `Search Pieces Drive`.
**via Keyboard Shortcut**
1. You can quickly open the search bar menu by pressing `alt+m`, letting go, and then quickly pressing the `f` key.
Once you’ve opened the search bar, you can enter your search query to search for a specific snippet.
<Image src="https://storage.googleapis.com/hashnode_product_documentation_assets/visual_studio_extension_assets/using_snippets/saving_snippets/opening_snippet_markdown.gif" alt="" align="center" fullwidth="true" />
via Search Feature
If you know exactly what you’re looking for, you can search for specific snippets:
<Image src="https://storage.googleapis.com/hashnode_product_documentation_assets/visual_studio_extension_assets/using_snippets/saving_snippets/searching_snippets.gif" alt="" align="center" fullwidth="true" />
Adding Filters to Your Search
To refine your search results, you can sort and filter saved snippets in the Pieces Drive Sidebar.
Filtering Snippets
<Image src="https://storage.googleapis.com/hashnode_product_documentation_assets/visual_studio_extension_assets/using_snippets/saving_snippets/filtering_snippets.gif" alt="" align="center" fullwidth="true" />
Sorting Snippets
<Image src="https://storage.googleapis.com/hashnode_product_documentation_assets/visual_studio_extension_assets/using_snippets/saving_snippets/sorting_snippets.gif" alt="" align="center" fullwidth="true" />
Viewing and Reusing Saved Snippets
Saved snippets can be viewed with their metadata by opening them directly from the Pieces Sidebar. Just click on them once you find them.
From this view, use Quick Actions to copy the snippet or insert it at your cursor in the editor. Click Open Markdown Preview to see the snippet in markdown preview mode, or click on the snippet for a quick overview.
From this view, you can highlight and right-click to copy, or use ctrl+c to copy to your clipboard.
via Pieces Sidebar
In the Pieces Drive sidebar, you can insert a snippet into your note by clicking the Insert at Cursor button.
You can right-click a snippet and select Copy to Clipboard to paste it wherever you need.
Previewing Saved Snippets
When using the Pieces Drive sidebar in Visual Studio, click on the three vertical dots on a saved code snippet to delete it or choose from 6 other options:
View Preview |
Start Copilot Chat |
Copy to Clipboard |
|---|---|---|
Insert at cursor |
Generate Shareable Link |
Open Markdown Preview |
Real-Time Snippet Streaming
Every product in the Pieces Suite uses PiecesOS to collect information about the context of your snippets.
When you change a snippet in the Pieces Desktop App—such as its name, description, tags, or any other metadata—those updates automatically appear in your Pieces for Visual Studio Extension without needing to refresh.