我正在使用vscode-deno https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno扩展,尽管我打开了deno.enable
, deno.lint
and deno.unstable
在我的 vscode 设置中,它不会在保存时格式化我的代码,我认为这是预期的行为。
我改为使用保存时运行 https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave扩展来破解我的方式来运行deno fmt
文件保存,但我想知道是否有办法单独使用 Deno 扩展来做到这一点?
My .vscode/settings.json
:
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.ts$",
"cmd": "deno fmt ${file}"
}
]
}
}
找到了,我必须在保存时打开格式化并将 Deno 扩展指定为默认格式化程序
{
"deno.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)