# javascript, typescript: Inject GLSL and WGSL syntax in comment-labeled template literals \(\#55341\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/0953838ec24ce43b96fe9aeef2e4d620a2372578)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 0953838ec24ce43b96fe9aeef2e4d620a2372578

Requested commit: 0953838ec24ce43b96fe9aeef2e4d620a2372578

Commit: 0953838ec24ce43b96fe9aeef2e4d620a2372578

Tree: d968fa6a65af210cb9cdcb3571e4345cc23ae62c

Author: Sergey Borovikov

Committer: GitHub

## Message

```
javascript, typescript: Inject GLSL and WGSL syntax in comment-labeled template literals (#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
```

## Parents

- [585e4aab0891effe0875fc7329b6bd50e7705750](https://git.cafe/gitcafe/zed/commit/585e4aab0891effe0875fc7329b6bd50e7705750?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/0953838ec24ce43b96fe9aeef2e4d620a2372578?format=markdown)
