Home  >  Article  >  Backend Development  >  How can I configure github.com/jinliming2/vscode-go-template to accept custom file extensions?

How can I configure github.com/jinliming2/vscode-go-template to accept custom file extensions?

PHPz
PHPzforward
2024-02-06 08:42:111359browse

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

Question content

According to https://marketplace.visualstudio.com/items?itemName=jinliming2.vscode-go-template, this VS Code extension Go template language syntax highlighting for any custom file extension should be supported (see screenshot below). However, I can't seem to deduce from that documentation how to specify a custom file extension to which syntax highlighting should be applied. Does anyone know how to do this?


Correct answer


FromHow to make VS Code treat file extensions as a language? by going to "File Associations" in settings and adding (in my case) the key-value pair *tmpl: go-template.

Files with the .tmpl file extension will now be highlighted as Go Template Language:

The above is the detailed content of How can I configure github.com/jinliming2/vscode-go-template to accept custom file extensions?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete