Skip to content

Commit 728c2e2

Browse files
authored
feat: Add HEEx support (#268)
1 parent 6b2ee45 commit 728c2e2

File tree

5 files changed

+66
-1
lines changed

5 files changed

+66
-1
lines changed

.gitmodules

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@
456456
ignore = dirty
457457
[submodule "repos/hlsl"]
458458
path = repos/hlsl
459-
url = https://github.com/theHamsta/tree-sitter-hlsl
459+
url = https://github.com/theHamsta/tree-sitter-hlsl
460460
branch = master
461461
update = none
462462
ignore = dirty
@@ -478,3 +478,9 @@
478478
branch = master
479479
update = none
480480
ignore = dirty
481+
[submodule "repos/heex"]
482+
path = repos/heex
483+
url = https://github.com/phoenixframework/tree-sitter-heex
484+
branch = main
485+
update = none
486+
ignore = dirty

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Unreleased
4+
- Add `HEEx` support
45

56
## 0.12.67 - 2023-10-11
67
- Add `Astro` support

queries/heex/highlights.scm

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
; HEEx delimiters
2+
[
3+
"%>"
4+
"--%>"
5+
"-->"
6+
"/>"
7+
"<!"
8+
"<!--"
9+
"<"
10+
"<%!--"
11+
"<%"
12+
"<%#"
13+
"<%%="
14+
"<%="
15+
"</"
16+
"</:"
17+
"<:"
18+
">"
19+
"{"
20+
"}"
21+
] @tag.delimiter
22+
23+
; HEEx operators are highlighted as such
24+
"=" @operator
25+
26+
; HEEx inherits the DOCTYPE tag from HTML
27+
(doctype) @constant
28+
29+
; HEEx comments are highlighted as such
30+
(comment) @comment @spell
31+
32+
; HEEx text content is treated as markup
33+
(text) @text
34+
35+
; Tree-sitter parser errors
36+
(ERROR) @error
37+
38+
; HEEx tags and slots are highlighted as HTML
39+
[
40+
(tag_name)
41+
(slot_name)
42+
] @tag
43+
44+
; HEEx attributes are highlighted as HTML attributes
45+
(attribute_name) @tag.attribute
46+
[
47+
(attribute_value)
48+
(quoted_attribute_value)
49+
] @string
50+
51+
; HEEx components are highlighted as modules and function calls
52+
(component_name [
53+
(module) @type
54+
(function) @function
55+
"." @punctuation.delimiter
56+
])

repos/heex

Submodule heex added at 4a36c9a

tree-sitter-langs.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ See `tree-sitter-langs-repos'."
139139
(haskell-mode . haskell)
140140
(hcl-mode . hcl)
141141
(terraform-mode . hcl)
142+
(heex-mode . heex)
142143
(hlsl-mode . hlsl)
143144
(html-mode . html)
144145
(markdown-mode . markdown)

0 commit comments

Comments
 (0)