Articles on: FAQs

How to: Pieces for IntelliJ

💡 What does the Pieces for IntelliJ plugin do for me?

The Pieces for IntelliJ plugin enables users to save and reuse code snippets and files directly from IntelliJ without having the Pieces app open.

Features & Descriptive Information:



How do I install the Pieces for IntelliJ Plugin?



Installing Pieces for IntelliJ



To get started, first install Pieces OS and the Pieces app through our site here.

💡 Pieces OS is the helper service that enables Pieces to function locally on your machine and manages connections to Pieces integrations.

Once downloaded, click to open Pieces OS. This will also automatically launch the Pieces app. You now have the Pieces app installed!





Install Pieces for IntelliJ through the JetBrains marketplace, from our site or from inside the IntelliJ app by going to Preferences > Plugins and searching for Pieces.





Saving snippets and files to Pieces from IntelliJ



From IntelliJ, simply highlight the snippet or file and save with:

1) Keyboard Shortcut

Windows: CTRL + P twice
Mac: ⌘⌥P

2) Right-click

Right-click and select “Save to Pieces”

Context that’s automatically captured when saving to Pieces from IntelliJ



Pieces captures information like a snippet’s source and tags it to make it simple to find later on.

Auto-save



Pieces can intelligently identify and save snippets based on re-use patterns in your workflow in JetBrains.

You'll see a "Saved a Piece!" confirmation in the bottom right of your screen. Your snippet is now saved in Pieces with a default name and automatically classified by language.

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

View your saved snippets in IntelliJ



Right-click in your code and select “My Saved Pieces.”

You’ll see an additional pop up with your snippet titles listed by name.

Refresh your Saved Pieces in your IDE



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

This will refresh your list view to reflect the Pieces for Developers carousel.

Browsing your Snippets



View your saved snippets inside IntelliJ via the right-click menu or from the Tools menu.
Insert a saved snippet to your cursor position via the right-click menu or from the Tools menu.

Updated on: 16/05/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!