Add HEEx language support, add missing commentstrings

This commit is contained in:
Clay 2021-08-15 09:40:02 -07:00 committed by Thomas Vigouroux
parent b8a6928b52
commit 57c2081e3f
14 changed files with 87 additions and 7 deletions

5
queries/heex/folds.scm Normal file
View file

@ -0,0 +1,5 @@
; HEEx folds similar to HTML
[
(tag)
(component)
] @fold

View file

@ -0,0 +1,35 @@
; HEEx text is highlighted as such
(text) @text
; HEEx has two types of comments, both are highlighted as such
(comment) @comment
; HEEx attributes are highlighted as HTML attributes
(attribute_name) @tag.attribute
; Attributes are highlighted as strings
(quoted_attribute_value) @string
; HEEx supports HTML tags and are highlighted as such
[
"<"
">"
"</"
"/>"
"<%"
"<%="
"<%%="
"<%#"
"%>"
"{"
"}"
] @tag.delimiter
; HEEx tags are highlighted as HTML
(tag_name) @tag
; HEEx components are highlighted as types (Elixir modules)
(component_name) @type
; HEEx operators
["="] @operator

11
queries/heex/indents.scm Normal file
View file

@ -0,0 +1,11 @@
; HEEx indents like HTML
[
(component)
(tag)
] @indent
; Dedent at the end of each tag
[
(end_tag)
(end_component)
] @branch

View file

@ -0,0 +1,7 @@
; Directives are combined to support do blocks
(directive (expression_value) @elixir @combined)
; Expressions are not combined, as they exist separately from do blocks
(expression (expression_value) @elixir)
(comment) @comment