mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
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
This commit is contained in:
parent
ee9d8cea45
commit
76bf941e09
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue