Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Syntax Highlight CommentNew to Visual Studio Code? Get it now.
Syntax Highlight Comment

Syntax Highlight Comment

Paul Murray

|
1 install
| (0) | Free
Enable syntax highlighting in JS/TS template literals using comment markers like /** css */.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-syntax-highlight-comment

Syntax highlight template literals in JavaScript and TypeScript by placing a comment immediately before the backtick.

Example

/**
 * Works with template litersals.
 */

const foo = /** css */ `.div { color: green }`;
const bar = /** html */ `<div>haha</div>`;
const baz = /** shell */ `npm run install`;

/**
 * Also works with tagged template literals.
 */

const qux = /** css */ test`.btn { color: green }`;
const lux = /** html */ test`<div>haha</div>`;
const mux = /** shell */ test`npm run install`;

Example syntax highlighting

Notes

  • Marker comment must be directly before the template literal (or its tag expression), optionally with whitespace in between.
  • Basic ${...} interpolation is supported inside marked template literals.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft