1. Plugin Development
Installation of scaffolding
Make sure you have Node.js and Git installed, then install Yeoman and VS Code Extension Generator with:
npm install -g yo generator-code | yarn global add yo generator-code
Create project
yo code
Select Code Snippets
Project Catalog
.
├── CHANGELOG.md
├── README.md
├── package.json
├── snippets
│ └── snippets.code-snippets
└── vsc-extension-quickstart.md
Writing code snippets
// snippets.code-snippets{ "AIP function component": { "prefix": "AIP-Snippets", "body": [ "import React from 'react';", "", "const ${1:App} = props => {", " return (", " <div>", " ${0}", " </div>", " );", "}", "", "", "export default ${1:App};" ], "description": "Code snippet for react function component" }, "Second": { "prefix": "Second", "body": [ "import React from 'react';", ], "description": "Code snippet for react function component" }}
The structure content is as follows
AIP function componentCode snippet nameprefixCode snippet hintbodyCode fragment contentdescriptionCode fragment description
Code snippet syntax
2. Use
1. Install
npm install -g vsce | yarn global add vsce
2. Publish
Local
vsce package
Application Market
-
Visit login.live.com/ to log in to your Microsoft account
-
Visit aka.ms/SignupAzure…
-
-
Record Access Token(important)
-
Visit aka.ms/vscode-crea…
-
vsce login [ID]
vsce publishvsce publish patch