mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
feat(queries): add typescript and javascript queries
This commit is contained in:
parent
ca438b7b2e
commit
ac8ae3b1c7
5 changed files with 479 additions and 2 deletions
35
queries/javascript/locals.scm
Normal file
35
queries/javascript/locals.scm
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
; Scopes
|
||||
;-------
|
||||
|
||||
(statement_block) @scope
|
||||
(function) @scope
|
||||
(arrow_function) @scope
|
||||
(function_declaration) @scope
|
||||
(method_definition) @scope
|
||||
|
||||
; Definitions
|
||||
;------------
|
||||
|
||||
(formal_parameters
|
||||
(identifier) @definition)
|
||||
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(identifier) @definition))
|
||||
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier) @definition))
|
||||
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @definition))
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @definition)
|
||||
|
||||
; References
|
||||
;------------
|
||||
|
||||
(identifier) @reference
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue