nvim-treesitter/runtime/queries/ecma/locals.scm
2023-09-09 16:17:08 +02:00

37 lines
805 B
Scheme

; Scopes
;-------
(statement_block) @local.scope
(function) @local.scope
(arrow_function) @local.scope
(function_declaration) @local.scope
(method_definition) @local.scope
(for_statement) @local.scope
(for_in_statement) @local.scope
(catch_clause) @local.scope
; Definitions
;------------
(variable_declarator
name: (identifier) @local.definition.var)
(import_specifier
(identifier) @local.definition.import)
(namespace_import
(identifier) @local.definition.import)
(function_declaration
((identifier) @local.definition.function)
(#set! definition.var.scope parent))
(method_definition
((property_identifier) @local.definition.function)
(#set! definition.var.scope parent))
; References
;------------
(identifier) @local.reference
(shorthand_property_identifier) @local.reference