EJS syntax highlighting for Visual Studio Code. Colorizes embedded JavaScript tags, expressions, and comments inside your EJS templates with full theme support.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Colorizes all EJS tag variants with full theme compatibility
Delegates JavaScript inside tags to VS Code's built-in JS grammar
Delegates HTML outside tags to VS Code's built-in HTML grammar
Works with any color theme
Tag Support
Tag
Purpose
<% %>
Scriptlet — executes JavaScript, no output
<%= %>
Escaped output
<%- %>
Unescaped output
<%# %>
Comment — not executed, not rendered
<%_ %>
Whitespace-slurping scriptlet
-%>
Trims trailing newline
_%>
Trims trailing whitespace
Requirements
VS Code 1.116.0 or later. No additional dependencies.
Extension Settings
This extension has no configurable settings.
Known Issues
EJS tags inside HTML comments (<!-- <%= value %> -->) are not colorized. The HTML grammar applies a flat comment color across the entire comment region, which overrides EJS token colors. This is a limitation of how VS Code layers TextMate grammars and does not affect functionality.