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:
Open the Pieces Drive
There are three main ways to search your Pieces Drive via the Pieces Sidebar
via Right-Click Menu
Right-click in your editor window, hover over Pieces
, and select Search Pieces Drive
.
via Keyboard Shortcut
- You can quickly open the search bar menu by pressing
alt+m
, letting go, and then quickly pressing thef
key.
Once you’ve opened the search bar, you can enter your search query to search for a specific snippet.
Open a Snippet
Click on the snippet to see its content, metadata, and quick actions.
via Search Feature
If you know exactly what you’re looking for, you can search for specific snippets:
Click the Search Bar
Open the search bar at the top of the Pieces Drive Sidebar.
Enter Your Search Query
Type your search query into the search box.
Navigate the Results
Scroll through the results or use the arrow keys to select your desired snippet.
Open the Snippet
Click on the snippet to open it and view its content, metadata, and quick actions.
Search using tags, descriptions, names, types, or languages to narrow your results.
Adding Filters to Your Search
To refine your search results, you can sort and filter saved snippets in the Pieces Drive Sidebar.
Filtering Snippets
Click on the Search Bar
Click the search bar at the top of the Pieces Drive Sidebar.
Use Quick Filters
Apply quick filters like Titles
, Annotations
, or Content
that show up below the search bar.
Filter by Tags or Keywords
Enter specific tags or keywords in the search bar to narrow down the snippets shown.
Sorting Snippets
Click the Sorting Icon
Click the icon at the top of the Pieces Drive sidebar (like the clock icon for recent). The icon changes depending on the sorting method you choose.
Choose Sorting Order
Choose your sorting order: Recent
, Suggested
, Alphabetical
, or Language
.
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:
|
|
|
---|---|---|
|
|
|
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 for Developers 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.
If your snippets aren’t updating immediately, refer to the troubleshooting guide for instructions on refreshing your snippet list.