summaryrefslogtreecommitdiff
path: root/vendor/queries/ruby/textobjects.scm
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/queries/ruby/textobjects.scm')
-rw-r--r--vendor/queries/ruby/textobjects.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/vendor/queries/ruby/textobjects.scm b/vendor/queries/ruby/textobjects.scm
new file mode 100644
index 00000000..368d80b9
--- /dev/null
+++ b/vendor/queries/ruby/textobjects.scm
@@ -0,0 +1,61 @@
+; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389:
+; runtime/queries/ruby/textobjects.scm.
+; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE,
+; https://mozilla.org/MPL/2.0/).
+
+; 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
+
+(module
+ body: (_)? @class.inside) @class.around
+
+; Functions and Blocks
+(singleton_method
+ body: (_)? @function.inside) @function.around
+
+(method
+ body: (_)? @function.inside) @function.around
+
+(do_block
+ body: (_)? @function.inside) @function.around
+
+(block
+ body: (_)? @function.inside) @function.around
+
+; Parameters
+(method_parameters
+ (_) @parameter.inside) @parameter.around
+
+(block_parameters
+ (_) @parameter.inside) @parameter.around
+
+(lambda_parameters
+ (_) @parameter.inside) @parameter.around
+
+; Comments
+(comment) @comment.inside
+(comment)+ @comment.around
+
+(pair
+ (_) @entry.inside) @entry.around
+
+(array
+ (_) @entry.around)
+
+(string_array
+ (_) @entry.around)
+
+(symbol_array
+ (_) @entry.around)