Skip to content

Insert Snippets in to current file in VS Code

Problem to Solve

Snippets inside of a user account must be copy/pasted out of GitLab and into a file when they need to be used in another place. This is error prone and time consuming to context switch and find the appropriate Snippet and then paste the contents in to the file you're working on.

Proposal

Create a command for Insert Snippet that talks to the GitLab Snippets API to retrieve a list of Snippets and then choose which file to insert.

image

  • If a user selects insert snippet from the command palette, display a list of single file project scoped snippets in the modal
  • If a user selects a snippet from the list insert it's content to the editor at the cursor position

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖