mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-08 22:40:12 -04:00
chore: create ecma base for use in js and ts which fixes jsx issues
This commit is contained in:
parent
ec41db9511
commit
3b8c2ea492
15 changed files with 411 additions and 412 deletions
|
|
@ -1,63 +1 @@
|
|||
; inherits: (jsx)
|
||||
|
||||
; 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
|
||||
;------------
|
||||
|
||||
(formal_parameters
|
||||
(identifier) @definition.parameter)
|
||||
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(identifier) @definition.parameter))
|
||||
|
||||
; function(arg = []) {
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
(shorthand_property_identifier) @definition.parameter))
|
||||
|
||||
; x => x
|
||||
(arrow_function
|
||||
parameter: (identifier) @definition.parameter)
|
||||
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier) @definition.parameter))
|
||||
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @definition.parameter))
|
||||
|
||||
(formal_parameters
|
||||
(rest_parameter
|
||||
(identifier) @definition.parameter))
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @definition.var)
|
||||
|
||||
(import_specifier
|
||||
(identifier) @definition.import)
|
||||
|
||||
(namespace_import
|
||||
(identifier) @definition.import)
|
||||
|
||||
(function_declaration
|
||||
((identifier) @definition.var)
|
||||
(#set! definition.var.scope parent))
|
||||
|
||||
; References
|
||||
;------------
|
||||
|
||||
(identifier) @reference
|
||||
(shorthand_property_identifier) @reference
|
||||
; inherits: ecma,jsx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue