on master help sign in
erlang: highlight unary '#' as punctuation.bracket

The '#' character may either be interpreted as a map when used like so: %% Example 1 #{a => b} Or as an operator which updates an existing map when the left-hand side is an expression: %% Example 2 MyMap#{a => b} This commit changes the highlight to `punctuation.bracket` when used as a character in a literal map (example 1) and keeps the `operator` highlight when used for updating (example 2).

commitbd527c84e64f8a30bb1ae8c4dd634d6deba20825 authorMichael Davis <mcarsondavis@gmail.com> dateWed 15 Jun 2022, 15:25 (4 years ago) parentd523280
1 file changed+2−2
runtime/queries/erlang/highlights.scm+2−2
runtime/queries/erlang/highlights.scm+2−2
@@ -92,7 +92,7 @@
9292
9393(binary_operator operator: _ @operator)
9494(unary_operator operator: _ @operator)
95−["/" ":" "#" "->"] @operator
95+["/" ":" "->"] @operator
9696
9797(tripledot) @comment.discard
9898
@@ -123,6 +123,6 @@
123123
124124; Punctuation
125125["," "." "-" ";"] @punctuation.delimiter
126−["(" ")" "{" "}" "[" "]" "<<" ">>"] @punctuation.bracket
126+["(" ")" "#" "{" "}" "[" "]" "<<" ">>"] @punctuation.bracket
127127
128128; (ERROR) @error