百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

vscode-comment-tagged-templates

> 编程语言
开源

使用注释指定语言的 JS 和 TS 标记模板字符串的语法高亮

197 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用注释指定语言的 JS 和 TS 标记模板字符串的语法高亮

VS Code extension that adds basic syntax highlighting for JavaScript and TypeScript tagged template strings using language identifier comments:

typescript
const cssString = /* css */ `
    button {
        color: hotpink !important;
    }
`;

const htmlString = /* html */`
    
        Click me!
    
`;

Usage

The language identifier comment must appear before the opening backtick for the template string. Here is basic list of valid identifiers (note that some languages require that you install an VS Code extension that provides a grammar for that language):

Language Supported Identifiers
css css, css.erb
basic html, htm, shtml, xhtml, inc, tmpl, tpl
ini ini, conf
java java, bsh
lua lua
makefile Makefile, makefile, GNUmakefile, OCamlMakefile
perl perl, pl, pm, pod, t, PL, psgi, vcl
r R, r, s, S, Rprofile
ruby ruby, rb, rbx, rjs, Rakefile, rake, cgi, fcgi, gemspec, irbrc, Capfile, ru, prawn, Cheffile, Gemfile, Guardfile, Hobofile, Vagrantfile, Appraisals, Rantfile, Berksfile, Berksfile.lock, Thorfile, Puppetfile
php php, php3, php4, php5, phpt, phtml, aw, ctp
sql sql, ddl, dml
vs_net vb
xml xml, xsd, tld, jsp, pt, cpt, dtml, rss, opml
xsl xsl, xslt
yaml yaml, yml
dosbatch bat, batch
clojure clj, cljs, clojure
coffee coffee, Cakefile, coffee.erb
c c, h
cpp cpp, c++, cxx
diff patch, diff, rej
dockerfile dockerfile, Dockerfile
git_commit COMMIT_EDITMSG, MERGE_MSG
git_rebase git-rebase-todo
go go, golang
graphql gql, qgl, graphql
groovy groovy, gvy
pug jade, pug
js js, jsx, javascript, es6, mjs
js_regexp regexp
json json, sublime-settings, sublime-menu, sublime-keymap, sublime-mousemap, sublime-theme, sublime-build, sublime-project, sublime-completions
less less
md md, markdown
mjml mjml
objc objectivec, objective-c, mm, objc, obj-c, m, h
scss scss
perl6 perl6, p6, pl6, pm6, nqp
powershell powershell, ps1, psm1, psd1
python python, py, py3, rpy, pyw, cpy, SConstruct, Sconstruct, sconstruct, SConscript, gyp, gypi
regexp_python re
rust rust, rs
scala scala, sbt
shell shell, sh, bash, zsh, bashrc, bash_profile, bash_login, profile, bash_logout, .textmate_init
ts typescript, ts
tsx tsx
csharp cs, csharp, c#
fsharp fs, fsharp, f#
dart dart
glsl glsl
liquid liquid
sparql sparql
applescript applescript
edgeql edgeql
cypher cypher, cyp, cql
prql prql
latex latex, tex
svg svg

Advanced language support

For IntelliSense and more advanced embedded language support, checkout these extensions:

  • lit-html — Html template intellisense
  • vscode-styled-components — CSS template Intellisense

Contributing

To build this extension, you'll need Git and Node.js.

First, fork this repo and clone your fork:

bash
git clone https://github.com/YOUR_GITHUB_ACCOUNT_NAME/vscode-comment-tagged-templates.git
code vscode-comment-tagged-templates

Then install dev dependencies using npm:

bash
npm install

The main grammar is generated using the script in build/build.js. To run it:

bash
npm run build

The generate grammar files will be written to the syntaxes directory. The grammar files are regenerated on each build so you should not make manual changes in them.

The supported languages are defined in build/languages.js

To run the tests:

bash
npm run test

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言