aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Davis2022-05-17 19:38:34 +0000
committerBlaž Hrastnik2022-05-25 12:26:26 +0000
commit82da9bd4f28cd2a050222173d6429478bed5b3cb (patch)
tree78a912e5f6d4c800a1e57c9e40ea2bfbdf69ba1d /runtime
parent45dd54082e4dde74b7d344c6bb8a4ff2a09e627e (diff)
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 '=:='.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/erlang/highlights.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/queries/erlang/highlights.scm b/runtime/queries/erlang/highlights.scm
index 1e075349..bea3871a 100644
--- a/runtime/queries/erlang/highlights.scm
+++ b/runtime/queries/erlang/highlights.scm
@@ -85,6 +85,11 @@
operator: "/"
right: (integer) @constant.numeric.integer)
+((binary_operator operator: _ @keyword.operator)
+ (#match? @keyword.operator "^\\w+$"))
+((unary_operator operator: _ @keyword.operator)
+ (#match? @keyword.operator "^\\w+$"))
+
(binary_operator operator: _ @operator)
(unary_operator operator: _ @operator)
["/" ":" "#" "->"] @operator