Skip to content

Commit ec85fb9

Browse files
authored
Improve HEEx comment highlights, inject comment lang (#3170)
1 parent dfc31e7 commit ec85fb9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

runtime/queries/heex/highlights.scm

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
; HEEx delimiters
33
[
44
"<!"
5-
"<!--"
65
"<"
7-
"<%!--"
86
"<%#"
97
">"
108
"</"
11-
"--%>"
12-
"-->"
139
"/>"
1410
; These could be `@keyword`s but the closing `>` wouldn't be highlighted
1511
; as `@keyword`
@@ -34,7 +30,13 @@
3430
(doctype) @constant
3531

3632
; HEEx comments are highlighted as such
37-
(comment) @comment
33+
[
34+
"<!--"
35+
"-->"
36+
"<%!--"
37+
"--%>"
38+
(comment)
39+
] @comment
3840

3941
; HEEx tags are highlighted as HTML
4042
(tag_name) @tag

runtime/queries/heex/injections.scm

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919
; <link href={ Routes.static_path(..) } />
2020
((expression (expression_value) @injection.content)
2121
(#set! injection.language "elixir"))
22+
23+
((comment) @injection.content
24+
(#set! injection.language "comment"))

0 commit comments

Comments
 (0)