2024-01-08 03:05:10 +01:00
|
|
|
; Function queries
|
|
|
|
|
|
|
|
(function_definition
|
2024-02-04 02:09:42 +01:00
|
|
|
body: (_) @function.inside) @function.around ; Does not include end marker
|
2024-01-08 03:05:10 +01:00
|
|
|
|
|
|
|
(lambda_expression
|
|
|
|
(_) @function.inside) @function.around
|
|
|
|
|
2024-02-04 02:09:42 +01:00
|
|
|
; Scala 3 braceless lambda
|
|
|
|
(colon_argument
|
|
|
|
(_) @function.inside) @function.around
|
|
|
|
|
2024-01-08 03:05:10 +01:00
|
|
|
|
|
|
|
; Class queries
|
|
|
|
|
|
|
|
(object_definition
|
|
|
|
body: (_)? @class.inside) @class.around
|
|
|
|
|
|
|
|
(class_definition
|
|
|
|
body: (_)? @class.inside) @class.around
|
|
|
|
|
|
|
|
(trait_definition
|
|
|
|
body: (_)? @class.inside) @class.around
|
|
|
|
|
|
|
|
(type_definition) @class.around
|
|
|
|
|
|
|
|
(enum_case_definitions) @class.around
|
|
|
|
|
|
|
|
(enum_definition
|
|
|
|
body: (_)? @class.inside) @class.around
|
|
|
|
|
|
|
|
|
|
|
|
; Parameter queries
|
|
|
|
|
|
|
|
(parameters
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
2024-02-04 02:09:42 +01:00
|
|
|
(class_parameters
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
2024-01-08 03:05:10 +01:00
|
|
|
(parameter_types
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
(bindings
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
; Does not match context bounds or higher-kinded types
|
|
|
|
(type_parameters
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
(arguments
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
(type_arguments
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
|
|
|
|
; Comment queries
|
|
|
|
|
2024-01-22 19:51:56 +01:00
|
|
|
[(comment) (block_comment)] @comment.inside
|
|
|
|
[(comment) (block_comment)] @comment.around ; Does not match consecutive block comments
|
2024-01-08 03:05:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
; Test queries
|
|
|
|
; Not supported
|