helix-mods/runtime/queries/java/textobjects.scm
Kalpaj Chaudhari c145999bff
treesitter: Add textobjects for native funcs and constructors (#9806)
This allows native functions and constructors to be accessible as part
of goto_{next,prev}_func.

Change-Id: Ia1234004e8b38e1c5871331a38fcf4f267da935e
2024-03-10 12:23:33 +09:00

38 lines
862 B
Scheme

(method_declaration
body: (_)? @function.inside) @function.around
(constructor_declaration
body: (_) @function.inside) @function.around
(interface_declaration
body: (_) @class.inside) @class.around
(class_declaration
body: (_) @class.inside) @class.around
(record_declaration
body: (_) @class.inside) @class.around
(enum_declaration
body: (_) @class.inside) @class.around
(formal_parameters
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(type_parameters
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(type_arguments
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(argument_list
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
[
(line_comment)
(block_comment)
] @comment.inside
(line_comment)+ @comment.around
(block_comment) @comment.around