英文:
How to configure github.com/jinliming2/vscode-go-template to accept a custom file extension?
问题
根据 https://marketplace.visualstudio.com/items?itemName=jinliming2.vscode-go-template,这个VS Code扩展应该支持Go模板语言的语法高亮显示,适用于任何自定义文件扩展名(见下面的截图)。然而,我从文档中无法推断出如何指定应用语法高亮显示的自定义文件扩展名。有人知道如何做吗?
英文:
According to https://marketplace.visualstudio.com/items?itemName=jinliming2.vscode-go-template, this VS Code extension should support Go template language syntax highlighting for any custom file extension (see screenshot below). What I can't seem to infer from that documentation, however, is how to specify custom file extensions to which syntax highlighting should apply. Does anyone know how to do that?
答案1
得分: 0
从https://stackoverflow.com/questions/29973619/how-to-make-vs-code-treat-a-file-extensions-as-a-certain-language,可以通过在设置中转到"文件关联"并添加(在我的情况下)键值对*tmpl
:go-template
来实现这一点。
现在,具有.tmpl
文件扩展名的文件将被突出显示为Go模板语言。
英文:
From https://stackoverflow.com/questions/29973619/how-to-make-vs-code-treat-a-file-extensions-as-a-certain-language, the way to do this is to go to "file associations" in settings and add (in my case) the key-value pair *tmpl
: go-template
.
Now files with the .tmpl
file extensions are highlighted as Go template language:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论