summaryrefslogtreecommitdiffstats
path: root/queries/hare/locals.scm
blob: 62eb6665b4a8d9fe504a1b1fd48d365003a784bc (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
; Scopes

[
  (module)
  (function_declaration)
  (if_statement)
  (for_statement)
  (match_expression)
  (switch_expression)
] @scope

; References

[
  (identifier)
  (scoped_type_identifier)
] @reference

; Definitions

(global_binding
  (identifier) @definition.constant . ":" (_))

(const_declaration
  "const" (identifier) @definition.constant . "=")

(field
  . (identifier) @definition.field)

(field_assignment
  . (identifier) @definition.field)

(function_declaration
  "fn" . (identifier) @definition.function)

(parameter
  (_) @definition.parameter . ":")

(type_declaration
  "type" (identifier) @definition.type . "=")

(type_declaration
  "type" (identifier) @definition.enum . "=" (enum_type))

(let_declaration
  "let" . (identifier) @definition.variable ","?)