How to Edit Snippets
You can edit several types of metadata when editing saved materials, as well as the saved piece of code itself.
To edit a snippet:
Open the Pieces Drive
Open the Pieces Drive via the JetBrains sidebar.
Start Editing the Snippet
Locate a snippet you want to edit and select Edit
from the quick menu, or right-click the snippet and choose Edit
from the menu.
Edit your Snippet
Make changes, then save using ⌘+s
(macOS) or ctrl+s
(Windows/Linux).
After saving, the editor will automatically return to the main snippet view, with your changes applied instantly.
Actions from the Pieces Drive View
A tool menu with Pieces features will appear when you left-click on a saved snippet in the Pieces Drive. Some options relate to the Pieces Copilot, while others handle material management actions.
Pieces Copilot Actions
To access the material management view, choose a snippet from Pieces Drive. You can select various Copilot-focused actions from here, as listed in the table below.
| Adds the snippet to the context of your existing Copilot Chat conversation. |
---|---|
| This triggers the input modal, which lets you type a prompt directly into the field without changing your active file view. |
| Inserts the code snippet at the point of your cursor inside your active file. |
| Shows shareable links that have been generated for that snippet, if applicable. |
Material Management Actions
Below the Pieces Copilot actions, you can quickly change a snippet's name, description, classification, and other enriched metadata. Check the table below for details.
| Add, adjust or delete annotations for the snippet. |
---|---|
| Add or remove links to the snippet’s metadata. |
| Add or remove tags to the snippet’s metadata. |
| Set your custom snippet classification. |
| Edit the content of the snippet. |
| Change the name (title) of the snippet as it appears in your repository of saved materials. |
| Delete the snippet. |
Additional Tools while Editing
Layers upon layers of functionality—that's the aim of all Pieces for Developers plugins and extensions.
When you edit a snippet (find it in the Pieces Drive menu and click Edit
), you can access all Pieces features, even though you're not in your main file view.
Instead, the Edit
view becomes your main file, so you can generate code comments, debug, add it to context, and more.