vscode-snippet扩展

vscode-snippet扩展.


相关资料


快速生成代码片段 snippets

  1. 使用非常简单, 新建一个 snippets_js.json 文件

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    {
    "Print to console": {
    "prefix": "log", # 提示关键字
    "body": [
    "console.log('$1');",
    "$2"
    ],
    "description": "Log output to console wilker"
    }
    }
  2. package.json 中指定 javascript 文件,时使用 这个代码提示

    1
    2
    3
    4
    5
    6
    7
    8
    "contributes": {
    "snippets": [
    {
    "language": "javascript",
    "path": "./snippets/snippets_js.json"
    }
    ]
    }
  3. 运行测试


高级使用