helix-mods/runtime/queries/ruby/textobjects.scm

45 lines
934 B
Scheme
Raw Normal View History

2022-11-08 02:43:00 +01:00
; Class and Modules
(class
body: (_)? @class.inside) @class.around
(singleton_class
value: (_)
(_)+ @class.inside) @class.around
(call
receiver: (constant) @class_const
method: (identifier) @class_method
(#match? @class_const "Class")
(#match? @class_method "new")
(do_block (_)+ @class.inside)) @class.around
2022-11-08 02:43:00 +01:00
(module
body: (_)? @class.inside) @class.around
2022-11-08 02:43:00 +01:00
; Functions and Blocks
(singleton_method
body: (_)? @function.inside) @function.around
2022-11-08 02:43:00 +01:00
(method
body: (_)? @function.inside) @function.around
(do_block
body: (_)? @function.inside) @function.around
(block
body: (_)? @function.inside) @function.around
; Parameters
(method_parameters
2022-11-08 02:43:00 +01:00
(_) @parameter.inside) @parameter.around
(block_parameters
2022-11-08 02:43:00 +01:00
(_) @parameter.inside) @parameter.around
(lambda_parameters
2022-11-08 02:43:00 +01:00
(_) @parameter.inside) @parameter.around
; Comments
(comment) @comment.inside
(comment)+ @comment.around