使用tmLanguage.yaml进行语言扩展时,希望它在保存时处理为tmLanguage.json,当我按Ctrl
+ Shift
+ B
时它会运行,但是有时我忘记了按下它。
FilePath:语法/mylanguage.tmLanguage.yaml
tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "yaml2json",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
package.json脚本定义
"scripts": {
"yaml2json": "npx js-yaml syntaxes/mylanguage.tmLanguage.yaml > syntaxes/mylanguage.tmLanguage.json"
},