nvim-treesitter/queries/ecma/locals.scm

43 lines
808 B
Scheme
Raw Normal View History

; Scopes
;-------
(statement_block) @local.scope
2024-01-06 15:05:50 +09:00
(function) @local.scope
2024-01-06 15:05:50 +09:00
(arrow_function) @local.scope
2024-01-06 15:05:50 +09:00
(function_declaration) @local.scope
2024-01-06 15:05:50 +09:00
(method_definition) @local.scope
2024-01-06 15:05:50 +09:00
(for_statement) @local.scope
2024-01-06 15:05:50 +09:00
(for_in_statement) @local.scope
2024-01-06 15:05:50 +09:00
(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)
2024-01-06 15:05:50 +09:00
(#set! definition.var.scope parent))
(method_definition
((property_identifier) @local.definition.function)
2024-01-06 15:05:50 +09:00
(#set! definition.var.scope parent))
; References
;------------
(identifier) @local.reference
2024-01-06 15:05:50 +09:00
(shorthand_property_identifier) @local.reference