summaryrefslogtreecommitdiff
path: root/runtime/queries/go/locals.scm
blob: 14a6f3e43c42b4dc55255b0d4165a3ab5cb87f62 (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
; Scopes

[
  (function_declaration)
  (type_declaration)
  (block)
] @local.scope

; Definitions

(type_parameter_list
  (parameter_declaration
    name: (identifier) @local.definition))

(parameter_declaration (identifier) @local.definition)
(variadic_parameter_declaration (identifier) @local.definition)

(short_var_declaration
  left: (expression_list
          (identifier) @local.definition))

(var_spec
  (identifier) @local.definition)

(for_statement
 (range_clause
   left: (expression_list
           (identifier) @local.definition)))

(const_declaration
 (const_spec
  name: (identifier) @local.definition))

; References

(identifier) @local.reference
(field_identifier) @local.reference
(type_identifier) @local.reference