# languages: Add injections for string and tagged template literals for JS/TS\(X\) \(\#44180\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4096bc55bea787b15c9281945aca5b87ce1acdc5

Requested commit: 4096bc55bea787b15c9281945aca5b87ce1acdc5

Commit: 4096bc55bea787b15c9281945aca5b87ce1acdc5

Tree: 3768b3166185fc95ff0346463c9de6e496db2381

Author: Vitaly Slobodin

Committer: GitHub

## Message

````
languages: Add injections for string and tagged template literals for JS/TS(X) (#44180)

Hi! This pull request adds language injections for string and tagged
template literals for JS/TS(X).
This is similar to what [this
extension](https://marketplace.visualstudio.com/items?itemName=bierner.comment-tagged-templates)
provides for VSCode. This PR is inspired by this tweet
https://x.com/leaverou/status/1996306611208388953?s=46&t=foDQRPR8oIl1buTJ4kZoSQ

I've added injections queries for the following languages: HTML, CSS,
GraphQL and SQL.
This works for:

- String literals: `const cssString = /* css */'button { color: hotpink
!important; }';`
- Template literals: ```const cssString = /* css */`button { color:
hotpink !important; }`;```

All injections support the format with whitespaces inside, i.e. `/* html
*/` and without them `/*html*/`.

## Screenshots

|before|after|
|---------|-----------|
| <img width="1596" height="1476" alt="CleanShot 2025-12-04 at 21 12
00@2x"
src="https://github.com/user-attachments/assets/8e0fb758-41f0-43a8-93e6-ae28f79d7c8f"
/> | <img width="1576" height="1496" alt="CleanShot 2025-12-04 at 21 08
35@2x"
src="https://github.com/user-attachments/assets/b47bb9c1-224e-4a24-8f08-a459f1081449"
/>|

Release Notes:

- Added language injections for string and tagged template literals in
JS/TS(X)
````

## Parents

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

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