How to Edit Snippets
To modify code you’ve saved to your personal repository, you can use the Pieces Drive view in Visual Studio.
If you don’t have it open, use the command palette shortcut ctrl+shift+p
and type Pieces Drive, then click it or press enter
to open the view.

<Image src="https://storage.googleapis.com/hashnode_product_documentation_assets/visual_studio_extension_assets/using_snippets/edit_update/edit_and_insert_snippet.gif" alt="" align="center" fullwidth="true" />
You’ll see a success message at the top of the active file indicating your changes have been made successfully.
Material Management Actions
From within the Pieces Drive view, you can click the three vertical dots to review a Quick Actions
tab that shows available metadata that you can view or directly adjust for that snippet.

You can view the table below for a comprehensive list of available actions.
Reclassify |
Set your custom snippet classification. |
---|---|
Rename |
Change the name (title) of the material as it appears in your Pieces Drive. |
Duplicate |
Create a duplicate of the saved material—unmodified or modified to be more performant, readable, as a template, or in another language. |
Related Links |
View, add, or remove related resources that provide additional context to the snippet. |
Tags |
Add or remove tags to the snippet’s metadata. |
Shareable Link |
Generate or copy a shareable link for the saved material. |
Annotations |
View or edit the automatically generated description for that saved code. |
Anchors |
Add associated files and directories to the material. |
Related People |
Manage related code authors or coworkers. |
Sensitive Information |
Manually add or remove a sensitive information tag to the snippet, if not automatically generated. |
Delete Piece |
Remove this saved material from Pieces Drive. |
Additional Tools while Editing
When you edit a saved snippet, you are opening a new file in Visual Studio to make those edits, which means that other Pieces functionalities, like functionalities provided by Pieces Copilot and Pieces Drive, are entirely available to you.
For example, when editing a snippet, right-clicking selected code will present you with the same toolbar and Pieces-related options (like Save Current Selection to Pieces
or Share Current Selection
).

This makes it easy to modify your saved code with the power that the Pieces for Visual Studio Extension gives you.