aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/ohm/textobjects.scm
blob: 855ad8de7181c1afba7feb84198fc8284c680fda (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
; See: https://docs.helix-editor.com/guides/textobject.html

; function.inside & around
; ------------------------

(rule
  body: (_) @function.inside) @function.around

; class.inside & around
; ---------------------

(grammar
  body: (_) @class.inside) @class.around

; parameter.inside & around
; -------------------------

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

(rule_body
  ((_) @parameter.inside . "|"? @parameter.around) @parameter.around)

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

(alt
  ((_) @parameter.inside . "|"? @parameter.around) @parameter.around)

; comment.inside
; --------------

(multiline_comment)+ @comment.inside
(singleline_comment)+ @comment.inside

; comment.around
; --------------

(multiline_comment)+ @comment.around
(singleline_comment)+ @comment.around