Pieces JetBrains Plugin

Using the Pieces for Developers JetBrains Plugin in combination with the Pieces Desktop App makes saving and reusing code simple within your IDE.

Installing the Pieces for Developers JetBrains Plugin#

In order to use the Pieces JetBrains Plugin, you must have Pieces OS. We recommend also using the Pieces for Developers desktop app.

You can install the JetBrains plugin through the JetBrains Marketplace or by searching for Pieces in the plugins search of your IDE.

Once you've installed the plugin, you can begin using Pieces without restarting your IDE.

Save Snippets to Pieces for JetBrains#

To save code to Pieces from your JetBrains IDE, simply highlight the snippet or file and save with:

  1. Keyboard Shortcut

    • Windows: CTRL + P(x2)

    • MacOS: CMD + P

  2. Right Click

    • Right-click and select "Save to Pieces"

View Saved Snippets#

There are a few ways to view your full list of code snippets in your IDE.

Right-click context menu:

  1. Right-click in your editor
  2. Find "My Saved Pieces" in the context menu
  3. When you hover over "My Saved Pieces," a pop out window will open on the side of the context menu, showing you a list of your saved code snippets

Sidebar Menu

  1. Find the Pieces for Developers Icon in the sidebar tray
  2. Select the Pieces Icon and a sidebar viewer will open with all of your snippets in a language-based list

The Sidebar Menu automatically expands the folder of language snippets that match the file where you're currently working.

Preview Saved Snippets in Markdown#

If you'd like to get a closer look at a snippet before adding it to your project, double-click on the snippet in the list view, and it will open in a Markdown preview. You'll be able to see the snippet and its context, including any tags, descriptions, titles, related links, and related people.

As it's super easy to open several previews at once, we've also made it simple to close all of those tabs. Right-click on a snippet tab and select "Close All Snippets" to instantly close every snippet tab except for the one you're focused on.

Refresh your Saved Snippets in your JetBrains IDE#

You can view your most recently saved snippets from the right-click context menu in JetBrains. To refresh that list after saving a new snippet:

  • Right-click in your code and select “Refresh Saved Pieces”


  • Click the refresh button at the top of the sidebar view

Sometimes, when saving new snippets from other plugins and extensions, you'll have to refresh your list to get a fully updated snippet list.

Search for Snippets with the JetBrains Plugin#

  1. Open the Search Everywhere Window
  2. Double-tap the shift key and switch to the Pieces tab or Use the Ctrl + Shift + P ([⌘⇧P] on macOS) keyboard shortcut to open a tab focused solely on your Pieces snippets
  3. Your search parameters will return snippets that you've saved

You can also find saved snippets while searching in the 'All' tab, as results come from anywhere in your IDE.

Edit Snippets with the JetBrains Plugin#

Editing a snippet is super easy and can be done within your IDE without opening a separate window. When you edit, a new tab will open so that you can adjust the contents of your code snippet.

To open and edit a previously saved snippet:

  1. Select the snippet in the Pieces tool window
  2. Hit Alt + Enter (⌥⏎ on macOS) or right-click and select “Edit…” from the pop-up menu
  3. Make your changes
  4. Save the snippet using Ctrl + S (⌘ + S on macOS)

You can adjust your snippet's name, description, and classification from the right-click context menu.

Use Suggested Save in JetBrains#

Pieces can intelligently identify and save snippets based on re-use patterns in your JetBrains workflow. Whenever Pieces saves a snippet, you'll see a "Saved a Piece!" confirmation in the bottom right corner of your screen. Your snippet is now saved in Pieces with a default name and automatically classified by language.

To opt-out of Suggested Save, go to Preferences > Tools > Pieces and click on Suggested Save.

Suggested Snippets#

Pieces offers you relevant code snippets based on your current activities and saved snippets. To access the suggested snippets, open the Pieces plugin and click on the dropdown menu labeled Suggested snippets. Here, you will be presented with a selection of code snippets that are closely aligned with your ongoing JetBrains workflow. The more you utilize the suggested code snippets, the more accurate and relevant they become to your coding style and the workflow.

Explored Materials#

Exploring materials with Pieces Insights enables you to gain deeper insights into a code snippet without needing to store it in your repository.

To Explore a material:

  1. Highlight a code snippet in your editor
  2. Right-click and select “Explore with Pieces Insights”
  3. Click the “View Insights” success message in the lower right corner of your editor
  4. Pieces will open a new window on the right side toolbar with a markdown file that showcases your snippet, its description, and other associated metadata
  5. To revisit explored materials, click on the Pieces icon on the right side toolbar or click Shift + Shift and search for Pieces Insights in the search bar

If you'd like to automatically save your explored materials to your Pieces repository, go to Settings > Tools > Pieces and click on Automatically save explored materials.

Explored materials can be organized independently for various JetBrains products, or they can be synchronized by selecting the desired preference from the dropdown menu within the insights storage settings.

In order to Explore Materials, you must be connected to your Pieces Cloud.

Related Materials#

Related materials are code snippets that are similar to the code you're currently working on. Pieces is capable of identifying related code snippets, even if you're interested in code that isn't originally part of the Pieces snippet. To find related materials:

  1. Highlight a code snippet in your editor
  2. Right-click and select “Find Related Materials in Pieces”
  3. Click the “View Insights” success message in the lower right corner of your editor to open the related materials in the Side Panel so that you can easily add them to your project.


The Pieces JetBrains Plugin will automatically update when a new version is available. You can also manually update the plugin by going to Plugins > Installed, finding Pieces, and clicking the update button.

Troubleshooting Common Installation Problems#

I can't find the Pieces JetBrains Plugin in the JetBrains Marketplace!#

If you can't find the Pieces for Developers JetBrains Plugin in the JetBrains Marketplace, you can naviagte directly to it with this link.

For any other issues with the Pieces for Developers JetBrains Plugin#

Go to Tools > Pieces and make sure to select appropriate options for your use case. If you're still having issues, please reach out to us at Pieces Support.

Uninstalling the Pieces Plugin#

To uninstall the Pieces for Developers JetBrains Plugin, go to Plugins > Installed, find the Pieces plugin, and click the uninstall button in the dropdown menu.

In order for Pieces to be completely uninstalled from the JetBrains IDE, you'll need to restart your IDE.