Searching

The Pieces for Visual Studio Extension lets you quickly find saved snippets, keeping you productive without interrupting your workflow.


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:

1

Open the Pieces Drive

There are three main ways to search your Pieces Drive via the Pieces Sidebar

via Right-Click Menu

  1. Right-click anywhere in your editor window

  2. Hover over Pieces and located Search Pieces Drive, select it

via Keyboard Shortcut

  1. Quickly open the search bar menu by pressing alt+m, letting go, and then quickly entering the f key

Once you’ve opened the search bar, you can enter your search query to search for a specific snippet

2

Open a Snippet

Click on the snippet you want 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:

1

Click the Search Bar

Open the search bar at the top of the Pieces Drive Sidebar

2

Enter Your Search Query

Type your search query into the search box

3

Navigate the Results

Scroll through the results or use arrow keys to select your desired snippet

4

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 down your results.

You can sort and filter saved snippets in the Pieces Drive Sidebar to refine your search results.

Filtering Snippets

1

Click on the Search Bar

Click the search bar at the top of the Pieces Drive Sidebar

2

Use Quick Filters

Apply quick filters like Titles, Annotations, or Content that show up below the search bar

3

Filter by Tags or Keywords

Enter specific tags or keywords in the search bar to narrow down the snippets shown

Sorting Snippets

1

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

2

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 Instert 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 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 how to refresh your snippet list.

Updated on