Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tree-sitters Erlang and HEEx #2149

Merged
merged 2 commits into from
Apr 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ language-server = { command = "erlang_ls" }

[[grammar]]
name = "erlang"
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "1e81393b8f0a81b35ff1679a9420fafbd2cf3511" }
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "3f611cfdc790214c3f9f9cf1658b3ae8039c54b8" }

[[language]]
name = "kotlin"
Expand Down
26 changes: 13 additions & 13 deletions runtime/queries/erlang/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@
])
(#eq? @keyword "define"))

(attribute
name: (atom) @keyword
(arguments
(_) @keyword.directive)
(#match? @keyword "ifn?def"))

(attribute
name: (atom) @keyword
module: (atom) @module
(#eq? @keyword "spec"))
(#eq? @keyword "(spec|callback)"))

; Functions
(function name: (atom) @function)
Expand All @@ -69,10 +75,7 @@
(record name: (atom) @type)

; Keywords
((attribute name: (atom) @keyword)
(#match?
@keyword
"^(define|export|export_type|include|include_lib|ifdef|ifndef|if|elif|else|endif|vsn|on_load|behaviour|record|file|type|opaque|spec)$"))
(attribute name: (atom) @keyword)

["case" "fun" "if" "of" "when" "end" "receive" "try" "catch" "after" "begin" "maybe"] @keyword

Expand All @@ -86,10 +89,6 @@
(unary_operator operator: _ @operator)
["/" ":" "#" "->"] @operator

; Comments
((variable) @comment.discard
(#match? @comment.discard "^_"))

(tripledot) @comment.discard

(comment) @comment
Expand All @@ -99,12 +98,13 @@
"?"+ @keyword.directive
name: (_) @keyword.directive)

; Comments
((variable) @comment.discard
(#match? @comment.discard "^_"))

; Basic types
(variable) @variable
[
(atom)
(quoted_atom)
] @string.special.symbol
(atom) @string.special.symbol
(string) @string
(character) @constant.character

Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/heex/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"--%>"
"-->"
"/>"
"{"
"}"
; These could be `@keyword`s but the closing `>` wouldn't be highlighted
; as `@keyword`
"<:"
Expand All @@ -21,6 +19,8 @@

; Non-comment or tag delimiters
[
"{"
"}"
"<%"
"<%="
"<%%="
Expand Down