如何配置github.com/jinliming2/vscode-go-template以接受自定义文件扩展名?

huangapple go评论95阅读模式
英文:

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模板语言的语法高亮显示,适用于任何自定义文件扩展名(见下面的截图)。然而,我从文档中无法推断出如何指定应用语法高亮显示的自定义文件扩展名。有人知道如何做吗?

如何配置github.com/jinliming2/vscode-go-template以接受自定义文件扩展名?

英文:

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?

如何配置github.com/jinliming2/vscode-go-template以接受自定义文件扩展名?

答案1

得分: 0

从https://stackoverflow.com/questions/29973619/how-to-make-vs-code-treat-a-file-extensions-as-a-certain-language,可以通过在设置中转到"文件关联"并添加(在我的情况下)键值对*tmplgo-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.

如何配置github.com/jinliming2/vscode-go-template以接受自定义文件扩展名?

Now files with the .tmpl file extensions are highlighted as Go template language:

如何配置github.com/jinliming2/vscode-go-template以接受自定义文件扩展名?

huangapple
  • 本文由 发表于 2023年1月8日 08:48:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75044806.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定