- Notifications
You must be signed in to change notification settings - Fork7
Generate a snippet extensions for vscode.
License
cipchk/vscode-snippet-generator
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Generate a snippet extensions for vscode.
- InstallDynamic Custom Snippets extension.
- Add snippet files into
.vscode/snippets/folder. (Please refer to the template contentSnippet tempalte) - The first time create the
.vscode/snippets/folder, need to restart vscode; otherwise you only need to trigger thevscode-snippet-generator: Cache all dynamic snippetscommand again.
Happy coding!!!
You can configure
"vscode-snippet-generator.prefix": ""insettings.jsonto change the prefix.You can configuae
"vscode-snippet-generator.languages": ["html", "typescript"]insettings.jsonto support language list.
$ git clone --depth 1 https://github.com/cipchk/vscode-snippet-generator-tpl.git$cd vscode-snippet-generator-tpl$# build$ npm run build$# package vscode extension$ npm run release
vscode-snippet-generator --help
Markdown file symbol of a specify snippet, like this:
---prefix:buttondescription:按钮scope:typescript,html---```html<button${1:type="${2|text,tel|}"}> $0<button>```
prefixdefines how this snippet is selected from IntelliSense and tab completion. In this casebutton.descriptionis the description used in the IntelliSense drop down.scopeRestrict template scope, if not specified, it means no restriction. In this casetypescriptandhtmldocument.- markdown body is defines snippet code, muse be hava a code tag.
How to writing snippet code, pls refre tovscode-Creating your own snippets
Thedescription support i18n, like this:
---prefix:buttondescription:zh-CN:按钮en-US:Button---
Specify language version to generate withi18n parameter.
vscode-snippet-generator --i18n=zh-CN --outFile=snippets-zh-CN.jsonvscode-snippet-generator --i18n=en-US --outFile=snippets-en-US.json
If you want to display multiple languages in a snippet extension, you can usei18nTpl.
# windowvscode-snippet-generator --i18nTpl=\"{zh-CN}({en-US})\"
The MIT License (see theLICENSE file for the full text)
About
Generate a snippet extensions for vscode.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.