on master help sign in
Improve HEEx comment highlights, inject comment lang (#3170)
ec85fb9Clay
runtime/queries/heex/highlights.scm+7−5
@@ -2,14 +2,10 @@
2; HEEx delimiters
2; HEEx delimiters
3[
3[
4 "<!"
4 "<!"
5− "<!--"
6 "<"
5 "<"
7− "<%!--"
8 "<%#"
6 "<%#"
9 ">"
7 ">"
10 "</"
8 "</"
11− "--%>"
12− "-->"
13 "/>"
9 "/>"
14 ; These could be `@keyword`s but the closing `>` wouldn't be highlighted
10 ; These could be `@keyword`s but the closing `>` wouldn't be highlighted
15 ; as `@keyword`
11 ; as `@keyword`
@@ -34,7 +30,13 @@
34(doctype) @constant
30(doctype) @constant
35
31
36; HEEx comments are highlighted as such
32; HEEx comments are highlighted as such
33+[
34+ "<!--"
35+ "-->"
36+ "<%!--"
37+ "--%>"
37−(comment) @comment
38+ (comment)
39+] @comment
38
40
39; HEEx tags are highlighted as HTML
41; HEEx tags are highlighted as HTML
40(tag_name) @tag
42(tag_name) @tag
runtime/queries/heex/injections.scm+3
@@ -19,3 +19,6 @@
19; <link href={ Routes.static_path(..) } />
19; <link href={ Routes.static_path(..) } />
20((expression (expression_value) @injection.content)
20((expression (expression_value) @injection.content)
21 (#set! injection.language "elixir"))
21 (#set! injection.language "elixir"))
22+
23+((comment) @injection.content
24+ (#set! injection.language "comment"))