Improve Ruby TextObjects (#4601)

pull/4648/head
Danillo Melo 2 years ago committed by GitHub
parent 535cf90093
commit 188aff059b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,11 +1,6 @@
; Class ; Class and Modules
(class) @class.around (class
body: (_)? @class.inside) @class.around
(class [(constant) (scope_resolution)] !superclass
(_)+ @class.inside)
(class [(constant) (scope_resolution)] (superclass)
(_)+ @class.inside)
(singleton_class (singleton_class
value: (_) value: (_)
@ -18,36 +13,31 @@
(#match? @class_method "new") (#match? @class_method "new")
(do_block (_)+ @class.inside)) @class.around (do_block (_)+ @class.inside)) @class.around
; Functions (module
(method) @function.around body: (_)? @class.inside) @class.around
(method (identifier) (method_parameters)
(_)+ @function.inside)
(do_block !parameters
(_)+ @function.inside)
(do_block (block_parameters) ; Functions and Blocks
(_)+ @function.inside) (singleton_method
body: (_)? @function.inside) @function.around
(block (block_parameters) (method
(_)+ @function.inside) body: (_)? @function.inside) @function.around
(block !parameters (do_block
(_)+ @function.inside) body: (_)? @function.inside) @function.around
(method (identifier) !parameters (block
(_)+ @function.inside) body: (_)? @function.inside) @function.around
; Parameters ; Parameters
(method_parameters (method_parameters
(_) @parameter.inside) (_) @parameter.inside) @parameter.around
(block_parameters (block_parameters
(_) @parameter.inside) (_) @parameter.inside) @parameter.around
(lambda_parameters (lambda_parameters
(_) @parameter.inside) (_) @parameter.inside) @parameter.around
; Comments ; Comments
(comment) @comment.inside (comment) @comment.inside

Loading…
Cancel
Save