From b5bbe2f3b99831e326fc585a16d6942f76682acb Mon Sep 17 00:00:00 2001 From: Emilio Srougo Date: Sun, 24 Mar 2024 19:51:35 -0600 Subject: [PATCH] Adapt to new tree-sitter last match wins --- queries/rescript/highlights.scm | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/queries/rescript/highlights.scm b/queries/rescript/highlights.scm index 268ab07..a1b9ea9 100644 --- a/queries/rescript/highlights.scm +++ b/queries/rescript/highlights.scm @@ -38,17 +38,6 @@ (record_pattern (value_identifier) @variable.member) -; highlight the right-hand side of a pipe operator as a function call -; this goes in this section to satisfy both the tree-sitter-cli and neovim. -; see comment below about `raise` -(pipe_expression - _ - [(value_identifier_path - _ - (value_identifier) @function.call) - (value_identifier) @function.call] - (#set! "priority" 105)) - (value_identifier_path (module_identifier) (value_identifier) @variable.member) @@ -115,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 _ @@ -206,6 +185,9 @@ "catch" ] @keyword.exception +(call_expression + function: (value_identifier) @keyword.exception + (#eq? @keyword.exception "raise")) [ "for"