2025-12-31 18:36:55 +01:00
|
|
|
; Scopes
|
|
|
|
|
;-------
|
|
|
|
|
(compound_statement) @local.scope
|
|
|
|
|
|
|
|
|
|
(for_statement) @local.scope
|
|
|
|
|
|
|
|
|
|
(function_decl) @local.scope
|
|
|
|
|
|
|
|
|
|
(constructor_literal) @local.scope
|
|
|
|
|
|
|
|
|
|
(function_literal) @local.scope
|
|
|
|
|
|
|
|
|
|
(with_statement) @local.scope
|
|
|
|
|
|
|
|
|
|
(catch_clause) @local.scope
|
|
|
|
|
|
|
|
|
|
; Definitions
|
|
|
|
|
;------------
|
|
|
|
|
(variable_decl
|
|
|
|
|
variable: (identifier) @local.definition.var)
|
|
|
|
|
|
|
|
|
|
(parameter
|
2025-12-31 19:08:06 +01:00
|
|
|
parameter: (identifier) @local.definition.parameter)
|
2025-12-31 18:36:55 +01:00
|
|
|
|
|
|
|
|
(import
|
|
|
|
|
module: (identifier) @local.definition.import)
|
|
|
|
|
|
|
|
|
|
(import
|
|
|
|
|
symbol: (identifier) @local.definition.import)
|
|
|
|
|
|
|
|
|
|
(function_decl
|
|
|
|
|
name: (identifier) @local.definition.function
|
|
|
|
|
(#set! definition.var.scope parent))
|
|
|
|
|
|
|
|
|
|
(class_decl
|
2025-12-31 19:14:40 +01:00
|
|
|
name: (identifier) @local.definition.type
|
2025-12-31 18:36:55 +01:00
|
|
|
(#set! definition.var.scope parent))
|
|
|
|
|
|
|
|
|
|
; References
|
|
|
|
|
;------------
|
|
|
|
|
(identifier) @local.reference
|