javascript, typescript: Inject GLSL and WGSL syntax in comment-labeled template literals - #55341
Conversation
|
What's the reason there's not a standardized optional comment syntax for injecting any arbitrary language highlights into multiline strings the same way jebtrains does, it feels odd to need to manually list every language inside each language for this to work |
|
@versecafe |
Have feedback on this plugin? Let's hear it! |
…d template literals
3fe8c16 to
cdde12f
Compare
…d template literals (zed-industries#55341) Extends the existing ECMAScript comment-label injection system to support GLSL and WGSL shader languages inside JS/TS strings and template literals. The pattern `/* language */` before a string is already used for `html`, `sql`, `graphql`, and `css`. This adds the same support for two shader languages commonly embedded as strings in WebGL/WebGPU code: before: <img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 05" src="https://github.com/user-attachments/assets/8952eddc-2f53-42ea-b086-7a0b63dceb10" /> after: <img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 39" src="https://github.com/user-attachments/assets/93bf536a-9df4-438b-af7b-382efda196ca" /> Syntax highlighting activates when the corresponding extension is installed: - GLSL: the built-in `glsl` extension - WGSL: the community extension [`wgsl-wesl-zed`](https://github.com/lucascompython/wgsl-wesl-zed) (language name `WGSL/WESL`) Both `/*glsl*/` and `/* glsl */` forms are accepted (same behavior as the existing patterns). Release Notes: - Added `/*glsl*/` and `/*wgsl*/` comment-label syntax injection for JavaScript and TypeScript template literals
…d template literals (zed-industries#55341) Extends the existing ECMAScript comment-label injection system to support GLSL and WGSL shader languages inside JS/TS strings and template literals. The pattern `/* language */` before a string is already used for `html`, `sql`, `graphql`, and `css`. This adds the same support for two shader languages commonly embedded as strings in WebGL/WebGPU code: before: <img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 05" src="https://github.com/user-attachments/assets/8952eddc-2f53-42ea-b086-7a0b63dceb10" /> after: <img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 39" src="https://github.com/user-attachments/assets/93bf536a-9df4-438b-af7b-382efda196ca" /> Syntax highlighting activates when the corresponding extension is installed: - GLSL: the built-in `glsl` extension - WGSL: the community extension [`wgsl-wesl-zed`](https://github.com/lucascompython/wgsl-wesl-zed) (language name `WGSL/WESL`) Both `/*glsl*/` and `/* glsl */` forms are accepted (same behavior as the existing patterns). Release Notes: - Added `/*glsl*/` and `/*wgsl*/` comment-label syntax injection for JavaScript and TypeScript template literals
Extends the existing ECMAScript comment-label injection system to support GLSL and WGSL shader languages inside JS/TS strings and template literals.
The pattern
/* language */before a string is already used forhtml,sql,graphql, andcss. This adds the same support for two shader languages commonly embedded as strings in WebGL/WebGPU code:before:

after:

Syntax highlighting activates when the corresponding extension is installed:
glslextensionwgsl-wesl-zed(language nameWGSL/WESL)Both
/*glsl*/and/* glsl */forms are accepted (same behavior as the existing patterns).Release Notes:
/*glsl*/and/*wgsl*/comment-label syntax injection for JavaScript and TypeScript template literals