summaryrefslogtreecommitdiff
path: root/vendor/queries/kotlin/textobjects.scm
blob: b02a8f7ee1c78f147f262e31eaafac1e3061a4d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389:
; runtime/queries/kotlin/textobjects.scm.
; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE,
; https://mozilla.org/MPL/2.0/).

(function_declaration
  (function_body)? @function.inside) @function.around

; Unlike function_body above, the constructor body is does not have its own
; symbol in the current grammar.
(secondary_constructor) @function.around

(class_declaration
  (class_body)? @class.inside) @class.around

(class_declaration
  (enum_class_body) @class.inside) @class.around

[
  (line_comment)
  (multiline_comment)
] @comment.inside

(line_comment)+ @comment.around

(multiline_comment) @comment.around

(enum_entry) @entry.around
(lambda_literal) @entry.around
(property_declaration) @entry.around
(object_declaration) @entry.around
(assignment) @entry.around

; TODO: This doesn't work with annotations yet, but fixing it without breaking
; the case of multiple parameters is non-trivial.
(function_value_parameters
  ((_) @parameter.inside . ","? @parameter.around) @parameter.around)

; secondary constructor uses function_value_parameters above
(primary_constructor
  ((_)@parameter.inside . ","? @parameter.around) @parameter.around)

(function_type_parameters
  ((_)@parameter.inside . ","? @parameter.around) @parameter.around)

(value_arguments
  ((_)@parameter.inside . ","? @parameter.around) @parameter.around)

(lambda_parameters
  ((_) @parameter.inside . ","? @parameter.around) @parameter.around)