Improve Ruby TextObjects (#4601)
This commit is contained in:
parent
535cf90093
commit
188aff059b
1 changed files with 21 additions and 31 deletions
|
@ -1,11 +1,6 @@
|
|||
; Class
|
||||
(class) @class.around
|
||||
|
||||
(class [(constant) (scope_resolution)] !superclass
|
||||
(_)+ @class.inside)
|
||||
|
||||
(class [(constant) (scope_resolution)] (superclass)
|
||||
(_)+ @class.inside)
|
||||
; Class and Modules
|
||||
(class
|
||||
body: (_)? @class.inside) @class.around
|
||||
|
||||
(singleton_class
|
||||
value: (_)
|
||||
|
@ -18,36 +13,31 @@
|
|||
(#match? @class_method "new")
|
||||
(do_block (_)+ @class.inside)) @class.around
|
||||
|
||||
; Functions
|
||||
(method) @function.around
|
||||
(module
|
||||
body: (_)? @class.inside) @class.around
|
||||
|
||||
(method (identifier) (method_parameters)
|
||||
(_)+ @function.inside)
|
||||
; Functions and Blocks
|
||||
(singleton_method
|
||||
body: (_)? @function.inside) @function.around
|
||||
|
||||
(do_block !parameters
|
||||
(_)+ @function.inside)
|
||||
(method
|
||||
body: (_)? @function.inside) @function.around
|
||||
|
||||
(do_block (block_parameters)
|
||||
(_)+ @function.inside)
|
||||
(do_block
|
||||
body: (_)? @function.inside) @function.around
|
||||
|
||||
(block (block_parameters)
|
||||
(_)+ @function.inside)
|
||||
|
||||
(block !parameters
|
||||
(_)+ @function.inside)
|
||||
|
||||
(method (identifier) !parameters
|
||||
(_)+ @function.inside)
|
||||
(block
|
||||
body: (_)? @function.inside) @function.around
|
||||
|
||||
; Parameters
|
||||
(method_parameters
|
||||
(_) @parameter.inside)
|
||||
(_) @parameter.inside) @parameter.around
|
||||
|
||||
(block_parameters
|
||||
(_) @parameter.inside)
|
||||
(_) @parameter.inside) @parameter.around
|
||||
|
||||
(lambda_parameters
|
||||
(_) @parameter.inside)
|
||||
(_) @parameter.inside) @parameter.around
|
||||
|
||||
; Comments
|
||||
(comment) @comment.inside
|
||||
|
|
Loading…
Reference in a new issue