diff options
author | Clay | 2022-07-24 02:49:52 +0000 |
---|---|---|
committer | GitHub | 2022-07-24 02:49:52 +0000 |
commit | ec85fb9ab6ff8a46f5a09d7e1134b153464dd08a (patch) | |
tree | 47f2e5dd707b837192f043f3b4494402398d7471 | |
parent | dfc31e74af1b96d9097496f1faa38710ecd30580 (diff) |
Improve HEEx comment highlights, inject comment lang (#3170)
-rw-r--r-- | runtime/queries/heex/highlights.scm | 12 | ||||
-rw-r--r-- | runtime/queries/heex/injections.scm | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/runtime/queries/heex/highlights.scm b/runtime/queries/heex/highlights.scm index 6d8816de..75537fa7 100644 --- a/runtime/queries/heex/highlights.scm +++ b/runtime/queries/heex/highlights.scm @@ -2,14 +2,10 @@ ; HEEx delimiters [ "<!" - "<!--" "<" - "<%!--" "<%#" ">" "</" - "--%>" - "-->" "/>" ; These could be `@keyword`s but the closing `>` wouldn't be highlighted ; as `@keyword` @@ -34,7 +30,13 @@ (doctype) @constant ; HEEx comments are highlighted as such -(comment) @comment +[ + "<!--" + "-->" + "<%!--" + "--%>" + (comment) +] @comment ; HEEx tags are highlighted as HTML (tag_name) @tag diff --git a/runtime/queries/heex/injections.scm b/runtime/queries/heex/injections.scm index ad4e4faa..d97e4b3e 100644 --- a/runtime/queries/heex/injections.scm +++ b/runtime/queries/heex/injections.scm @@ -19,3 +19,6 @@ ; <link href={ Routes.static_path(..) } /> ((expression (expression_value) @injection.content) (#set! injection.language "elixir")) + +((comment) @injection.content + (#set! injection.language "comment"))
\ No newline at end of file |