aboutsummaryrefslogtreecommitdiffstats
path: root/queries/ecma/locals.scm
blob: 4c035d269166a1c0d6043fcc9e39553e49c56021 (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
; Scopes
;-------

(statement_block) @scope
(function) @scope
(arrow_function) @scope
(function_declaration) @scope
(method_definition) @scope
(for_statement) @scope
(for_in_statement) @scope
(catch_clause) @scope

; Definitions
;------------

(variable_declarator
  name: (identifier) @definition.var)

(import_specifier
  (identifier) @definition.import)

(namespace_import
  (identifier) @definition.import)

(function_declaration
  ((identifier) @definition.function)
   (#set! definition.var.scope parent))

(method_definition
  ((property_identifier) @definition.function)
   (#set! definition.var.scope parent))

; References
;------------

(identifier) @reference
(shorthand_property_identifier) @reference