As developers, we all love to keep code snippets we can reuse later. Keeping track of our snippets in a document avoids searching for the same code block continuously and makes us more productive.
However, there is no great solution for sharing code snippets with your team. Existing solutions work well in the local development environment, but no tool helps you save and share code snippets with your team.
In this article, we explain how to create a private code snippet on Codiga and share it with your team.
Create a Code Snippet
Once the plugin/extension is installed, select the code you want to share, right-click and select
Create Code Snippet.
Once you create the code snippets, you can edit metadata to make the snippet easily discoverable on the Codiga Hub and all the Codiga Applications. Edit the metadata and make sure you add at least three keywords.
Share a Code Snippet with your Team
With Codiga, sharing a private code snippet requires just a click. When editing the code snippet, go to the
Groups tab and select the group you want to share the snippet with.
Once shared, the code snippet is visible in the
Group Sharing tab of the
Coding Assistant. You can list all the shared snippets with your group, as shown below.
Using Code Snippets from your team
Once code snippets are shared, this is time to use them! Once you are in VS Code, add your Codiga API token to your preferences.
Then, open the Codiga search snippets feature (CMD + SHIT + C for VS Code) and enter the keywords of your snippet.
Alternatively, you can start a command in a file and enter the code snippets keyword in the comment: Codiga will then suggest the snippet for you.
Search your Team Code Snippets on Desktop
When you are not coding (but reviewing code or just providing guidance to a colleague), you often want to access your code snippets.
For this use case, Codiga has a desktop app that lets you search and find code snippets, including the ones shared with your team.
You can then easily list all snippets and cookbooks shared with your team and also view and easily copy them.