Skip to content

Commit

Permalink
feat: Add HEEx support (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Oct 12, 2023
1 parent 6b2ee45 commit 728c2e2
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
ignore = dirty
[submodule "repos/hlsl"]
path = repos/hlsl
url = https://github.com/theHamsta/tree-sitter-hlsl
url = https://github.com/theHamsta/tree-sitter-hlsl
branch = master
update = none
ignore = dirty
Expand All @@ -478,3 +478,9 @@
branch = master
update = none
ignore = dirty
[submodule "repos/heex"]
path = repos/heex
url = https://github.com/phoenixframework/tree-sitter-heex
branch = main
update = none
ignore = dirty
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Add `HEEx` support

## 0.12.67 - 2023-10-11
- Add `Astro` support
Expand Down
56 changes: 56 additions & 0 deletions queries/heex/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
; 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) @text

; Tree-sitter parser errors
(ERROR) @error

; 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
])
1 change: 1 addition & 0 deletions repos/heex
Submodule heex added at 4a36c9
1 change: 1 addition & 0 deletions tree-sitter-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ See `tree-sitter-langs-repos'."
(haskell-mode . haskell)
(hcl-mode . hcl)
(terraform-mode . hcl)
(heex-mode . heex)
(hlsl-mode . hlsl)
(html-mode . html)
(markdown-mode . markdown)
Expand Down

0 comments on commit 728c2e2

Please sign in to comment.