Skip to content

Commit 82da9bd

Browse files
the-mikedavisarchseer
authored andcommitted
update Erlang grammar and queries
The update to the grammar itself covers the case where the document is a single expression without a trailing newline such as "min(A, B)". A small change to the parser now parses these expressions correctly which improves the display of the function head in the signature help popup. The update to the queries marks 'andalso', 'orelse', 'not', etc. as `@keyword.operator` which improves the look - it looks odd to see operators that are words highlighted the same as tokens like '->' or '=:='.
1 parent 45dd540 commit 82da9bd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

languages.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ language-server = { command = "erlang_ls" }
10491049

10501050
[[grammar]]
10511051
name = "erlang"
1052-
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "3f611cfdc790214c3f9f9cf1658b3ae8039c54b8" }
1052+
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "6cd8f956ada445b277de1581b5328ae8e8be9aac" }
10531053

10541054
[[language]]
10551055
name = "kotlin"

runtime/queries/erlang/highlights.scm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
operator: "/"
8686
right: (integer) @constant.numeric.integer)
8787

88+
((binary_operator operator: _ @keyword.operator)
89+
(#match? @keyword.operator "^\\w+$"))
90+
((unary_operator operator: _ @keyword.operator)
91+
(#match? @keyword.operator "^\\w+$"))
92+
8893
(binary_operator operator: _ @operator)
8994
(unary_operator operator: _ @operator)
9095
["/" ":" "#" "->"] @operator

0 commit comments

Comments
 (0)