From 3fd4d9fb3fc7ea86057e952f6db8f8641c615eb5 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 5 Aug 2021 16:17:18 +0200 Subject: Fix instance and singleton method locals for Ruby Ruby singleton methods (`def x.y ... end`) weren't covered in the list of locals. In addition, instance methods didn't support names that are capitalised (`def Integer ... end`). This commit ensures that both instance and singleton methods are supported, and that both support identifiers and constants as their names. This ensures that all following examples are covered: def foo; end def FOO; end def self.bar; end def self.BAR; end --- queries/ruby/locals.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'queries/ruby') diff --git a/queries/ruby/locals.scm b/queries/ruby/locals.scm index 7c703fd6e..fe85bf209 100644 --- a/queries/ruby/locals.scm +++ b/queries/ruby/locals.scm @@ -36,7 +36,8 @@ (module name: (constant) @definition.namespace) (class name: (constant) @definition.type) -(method name: (identifier) @definition.function) +(method name: [(identifier) (constant)] @definition.function) +(singleton_method name: [(identifier) (constant)] @definition.function) (method_parameters (identifier) @definition.var) (lambda_parameters (identifier) @definition.var) -- cgit v1.2.3-70-g09d2