Building my first VS Code Extension(Code Snippets)
I recently built my first VS Code extension and published it. It consists of basic code snippets that include commonly used React packages.
Code snippets are reusable blocks of code that can be inserted into your code editor with a single command or keyboard shortcut. Snippets can be used to save time by automating common tasks, such as creating boilerplate code or filling in repetitive code patterns. Snippets can also improve code quality by ensuring that code adheres to best practices or standards.
npm install -g yo generator-code
yo code
npm install -g vsce
"publisher": "publisherName",
vsce package
It will create a file in .vsix.
If it warns for empty repository the add
"repository": {
"private": true
},
and if it ask for license then add a LICENSE.md file
Click on "+ New Extension" and add .vsix file.
It will take some time for verifications and finally available in marketplace
Extension in VS Code Marketplace
Building a code snippets extension on VS Code is a great way to share your code snippets with others and improve your own productivity. With a few simple steps, you can create a custom extension that automates common tasks and adheres to best practices.
Hope you use this extension, like it, and review it.
Happy Coding!