Skip to content

Commit

Permalink
Adapt to new tree-sitter last match wins
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilios1995 committed Mar 25, 2024
1 parent 9a7e362 commit 8461c77
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions queries/rescript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@

; function calls

; neovim and tree-sitter-cli handle conflicts differently:
; in tree-sitter-cli the first match wins, while in neovim the last match does.
; to get the desired result for `raise` in both, we put it before the general function call
; queries (for the CLI), but also add a priority metadata rule (for neovim).

(call_expression
function: (value_identifier) @keyword.exception
(#set! "priority" 105)
(#eq? @keyword.exception "raise"))

(call_expression
function: (value_identifier_path
_
Expand Down Expand Up @@ -195,6 +185,9 @@
"catch"
] @keyword.exception

(call_expression
function: (value_identifier) @keyword.exception
(#eq? @keyword.exception "raise"))

[
"for"
Expand Down

0 comments on commit 8461c77

Please sign in to comment.