Sharing Snippets
The Share Snippets
feature in the Pieces for Sublime Text Plugin is designed to streamline the process of sharing code snippets with colleagues, collaborators, or the broader development community.
This feature lets users generate shareable links for their saved code snippets directly from the Pieces for Sublime interface.
What Information Gets Shared
When a snippet is saved to the Pieces Cloud, the code is enriched with valuable information such as related people, links, annotations, tags, and an automatically-generated description.
This information is visible to the right of the code block when the shared snippet is open in your browser:
Want to see what a shared snippet looks like for yourself?
Click here to check out a C# snippet that Pieces engineers used to launch a Confetti Cannon at a conference.
How to Generate Shareable Links
To generate a shareable link that can be shared anywhere:
-
Right click on a section of selected code
-
Hover over the Pieces option
-
Select the
Generate Shareable Link
option
This will then display a prompt where you can choose to Copy
or Dismiss
the shareable link.
When you click Generate Shareable Link
, the Pieces Copilot will generate the link, then open a small menu with two options—Copy
or Dismiss
, allowing you to either copy the link or disregard the link.
Selecting Copy
will copy the shareable URL to your clipboard:
This feature allows the recipient to easily access and view the snippet, even if they don't have Pieces installed or have a Pieces account.
Sharing a Previously Saved Snippet
In addition to sharing code snippets on the fly, you can also open up previously saved materials and generate a shareable link from the embedded Share
button.
Enriched Sharing Experience
When you Share
a snippet, it’s not just the code that’s included. The snippet comes with additional metadata to provide context—you can read more about that here.
-
Snippet Type
: Identify the language or framework, such as Python or React. -
Tags
: Useful keywords for quick categorization. -
Description
: A short summary of what the snippet does. -
Related Links
: Helpful resources or documentation tied to the snippet. -
Author Information
: A record of who created the snippet.
Sensitive Information Watchdog
The Generate Shareable Link
feature does more than just allow you to effectively share snippets across your entire team and other communities, though.
You'll see a section titled Sensitive Information:
Our in-house ML model scans snippets for potentially sensitive information, like API keys or passwords, and alerts you so that you can make an informed decision before sharing the snippet.
The scan happens locally using on-device machine learning models before the snippet is uploaded to the cloud for sharing—that way, you can make an informed decision about sharing your code.