Highlighting and formatting HTML/SVG code in JavaScript and TypeScript template literals #40083
Angelk90
started this conversation in
Feature Ideas / Enhancements
Replies: 1 comment
-
I'm not sure if the SCM queries allow for regex for defining injected languages yet. Not seen any extension do it that way. Tagged template strings work at the moment. As they are easily parseable by the tree-sitter. So things like:
...get parsed by the SQL extension if you have that installed. You can see what injections are currently set up in https://github.com/zed-industries/zed/blob/main/crates/languages/src/javascript/injections.scm and if/when Zed supports regex matching it would be added there. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, treats template literals in JavaScript and TypeScript as simple strings.
It would be helpful if Zed could automatically recognize and color the HTML or SVG code written within them, as VS Code does with the Template Literals extension.
Link: https://github.com/julienetie/vscode-template-literals
Examples:
Additionally, it would be great to be able to automatically format the HTML/SVG code contained in the template literal (indentation, tag closing, etc.).
This improves the readability of the code.
Beta Was this translation helpful? Give feedback.
All reactions