From 65771277a6330d3ee008bd470387e89498d8ff0d Mon Sep 17 00:00:00 2001 From: Vitaly Slobodin Date: Thu, 21 Aug 2025 21:28:29 +0200 Subject: [PATCH] fix(ruby): resolve precedence issue with import keyword detection * Remove requirement for import keywords to be inside a program call * Reorder the highlights to capture import keywords properly Closes https://github.com/zed-extensions/ruby/issues/157 --- languages/ruby/highlights.scm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/languages/ruby/highlights.scm b/languages/ruby/highlights.scm index e5bd1a6..2ee9103 100644 --- a/languages/ruby/highlights.scm +++ b/languages/ruby/highlights.scm @@ -41,16 +41,14 @@ ; Function calls -(program - (call - (identifier) @keyword.import) - (#any-of? @keyword.import "require" "require_relative" "load")) - -"defined?" @function.method.builtin - (call method: [(identifier) (constant)] @function.method) +((identifier) @keyword.import + (#any-of? @keyword.import "require" "require_relative" "load")) + +"defined?" @function.method.builtin + ; Function definitions (alias (identifier) @function.method)