mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 12:30:01 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,55 +1,55 @@
|
|||
; inherits: ecma,jsx
|
||||
|
||||
;;; Parameters
|
||||
(formal_parameters (identifier) @variable.parameter)
|
||||
; Parameters
|
||||
(formal_parameters
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
;; ({ a }) => null
|
||||
; ({ a }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter))
|
||||
|
||||
;; ({ a = b }) => null
|
||||
; ({ a = b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(object_assignment_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter)))
|
||||
|
||||
;; ({ a: b }) => null
|
||||
; ({ a: b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @variable.parameter)))
|
||||
|
||||
;; ([ a ]) => null
|
||||
; ([ a ]) => null
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
;; ({ a } = { a }) => null
|
||||
; ({ a } = { a }) => null
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter)))
|
||||
|
||||
;; ({ a = b } = { a }) => null
|
||||
; ({ a = b } = { a }) => null
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
(object_pattern
|
||||
(object_assignment_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter))))
|
||||
|
||||
;; a => null
|
||||
; a => null
|
||||
(arrow_function
|
||||
parameter: (identifier) @variable.parameter)
|
||||
|
||||
;; optional parameters
|
||||
; optional parameters
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @variable.parameter))
|
||||
|
||||
;; punctuation
|
||||
; punctuation
|
||||
(optional_chain) @punctuation.delimiter
|
||||
|
|
|
|||
|
|
@ -1,19 +1,23 @@
|
|||
; inherits: ecma,jsx
|
||||
|
||||
; Both properties are matched here.
|
||||
;
|
||||
; class Foo {
|
||||
; this.#bar = "baz";
|
||||
; this.quuz = "qux";
|
||||
; }
|
||||
(field_definition
|
||||
property: [(property_identifier) (private_property_identifier)] @local.definition.var)
|
||||
(field_definition
|
||||
property:
|
||||
[
|
||||
(property_identifier)
|
||||
(private_property_identifier)
|
||||
] @local.definition.var)
|
||||
|
||||
; this.foo = "bar"
|
||||
(assignment_expression
|
||||
left: (member_expression
|
||||
object: (this)
|
||||
property: (property_identifier) @local.definition.var))
|
||||
left:
|
||||
(member_expression
|
||||
object: (this)
|
||||
property: (property_identifier) @local.definition.var))
|
||||
|
||||
(formal_parameters
|
||||
(identifier) @local.definition.parameter)
|
||||
|
|
@ -27,18 +31,18 @@
|
|||
(arrow_function
|
||||
parameter: (identifier) @local.definition.parameter)
|
||||
|
||||
;; ({ a }) => null
|
||||
; ({ a }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @local.definition.parameter))
|
||||
|
||||
;; ({ a: b }) => null
|
||||
; ({ a: b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @local.definition.parameter)))
|
||||
|
||||
;; ([ a ]) => null
|
||||
; ([ a ]) => null
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @local.definition.parameter))
|
||||
|
|
@ -54,8 +58,11 @@
|
|||
; baz(y) { y }
|
||||
; }
|
||||
(method_definition
|
||||
([(property_identifier) (private_property_identifier)] @local.definition.function)
|
||||
(#set! definition.var.scope parent))
|
||||
([
|
||||
(property_identifier)
|
||||
(private_property_identifier)
|
||||
] @local.definition.function)
|
||||
(#set! definition.var.scope parent))
|
||||
|
||||
; this.foo()
|
||||
(member_expression
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue