aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/heex/highlights.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/heex/highlights.scm')
-rw-r--r--runtime/queries/heex/highlights.scm54
1 files changed, 54 insertions, 0 deletions
diff --git a/runtime/queries/heex/highlights.scm b/runtime/queries/heex/highlights.scm
new file mode 100644
index 000000000..e2fb01880
--- /dev/null
+++ b/runtime/queries/heex/highlights.scm
@@ -0,0 +1,54 @@
+; HEEx delimiters
+[
+ "%>"
+ "--%>"
+ "-->"
+ "/>"
+ "<!"
+ "<!--"
+ "<"
+ "<%!--"
+ "<%"
+ "<%#"
+ "<%%="
+ "<%="
+ "</"
+ "</:"
+ "<:"
+ ">"
+ "{"
+ "}"
+] @tag.delimiter
+
+; HEEx operators are highlighted as such
+"=" @operator
+
+; HEEx inherits the DOCTYPE tag from HTML
+(doctype) @constant
+
+; HEEx comments are highlighted as such
+(comment) @comment @spell
+
+; HEEx text content is treated as markup
+; (text) @none
+; HEEx tags and slots are highlighted as HTML
+[
+ (tag_name)
+ (slot_name)
+] @tag
+
+; HEEx attributes are highlighted as HTML attributes
+(attribute_name) @tag.attribute
+
+[
+ (attribute_value)
+ (quoted_attribute_value)
+] @string
+
+; HEEx components are highlighted as modules and function calls
+(component_name
+ [
+ (module) @type
+ (function) @function
+ "." @punctuation.delimiter
+ ])