aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/puppet/locals.scm
blob: f145fffbc46ed4dbcbd4449cd2a53978a63ba790 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
; Scopes
[
  (block)
  (defined_resource_type)
  (parameter_list)
  (attribute_type_entry)
  (class_definition)
  (node_definition)
  (resource_declaration)
  (selector)
  (iterator_statement)
  (case_statement)
  (hash)
  (array)
] @local.scope

; References
[
  (identifier)
  (class_identifier)
  (variable)
] @local.reference

; Definitions
(attribute
  [
    (identifier)
    (variable)
  ] @local.definition.field)

(function_declaration
  [
    (identifier)
    (class_identifier)
  ] @local.definition.function)

(include_statement
  [
    (identifier)
    (class_identifier)
  ] @local.definition.import)

(parameter
  (variable) @local.definition.parameter)

(class_definition
  [
    (identifier)
    (class_identifier)
  ] @local.definition.type)

(node_definition
  (node_name
    (identifier) @local.definition.type))

(resource_declaration
  [
    (identifier)
    (class_identifier)
  ] @local.definition.type)

(assignment
  .
  (variable) @local.definition.var)