mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
1
runtime/queries/javascript/folds.scm
Normal file
1
runtime/queries/javascript/folds.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
; inherits: ecma,jsx
|
||||
56
runtime/queries/javascript/highlights.scm
Normal file
56
runtime/queries/javascript/highlights.scm
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
; inherits: ecma,jsx
|
||||
|
||||
; Parameters
|
||||
(formal_parameters
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; ({ a }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter))
|
||||
|
||||
; ({ a = b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(object_assignment_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter)))
|
||||
|
||||
; ({ a: b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @variable.parameter)))
|
||||
|
||||
; ([ a ]) => null
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; ({ a } = { a }) => null
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter)))
|
||||
|
||||
; ({ a = b } = { a }) => null
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
(object_pattern
|
||||
(object_assignment_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter))))
|
||||
|
||||
; a => null
|
||||
(arrow_function
|
||||
parameter: (identifier) @variable.parameter)
|
||||
|
||||
; optional parameters
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @variable.parameter))
|
||||
|
||||
; punctuation
|
||||
(optional_chain) @punctuation.delimiter
|
||||
1
runtime/queries/javascript/indents.scm
Normal file
1
runtime/queries/javascript/indents.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
; inherits: ecma,jsx
|
||||
1
runtime/queries/javascript/injections.scm
Normal file
1
runtime/queries/javascript/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
; inherits: ecma,jsx
|
||||
69
runtime/queries/javascript/locals.scm
Normal file
69
runtime/queries/javascript/locals.scm
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
; 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)
|
||||
|
||||
; this.foo = "bar"
|
||||
(assignment_expression
|
||||
left: (member_expression
|
||||
object: (this)
|
||||
property: (property_identifier) @local.definition.var))
|
||||
|
||||
(formal_parameters
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
; function(arg = []) {
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @local.definition.parameter))
|
||||
|
||||
; x => x
|
||||
(arrow_function
|
||||
parameter: (identifier) @local.definition.parameter)
|
||||
|
||||
; ({ a }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @local.definition.parameter))
|
||||
|
||||
; ({ a: b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @local.definition.parameter)))
|
||||
|
||||
; ([ a ]) => null
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @local.definition.parameter))
|
||||
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @local.definition.parameter))
|
||||
|
||||
; Both methods are matched here.
|
||||
;
|
||||
; class Foo {
|
||||
; #bar(x) { x }
|
||||
; baz(y) { y }
|
||||
; }
|
||||
(method_definition
|
||||
[
|
||||
(property_identifier)
|
||||
(private_property_identifier)
|
||||
] @local.definition.function
|
||||
(#set! definition.var.scope parent))
|
||||
|
||||
; this.foo()
|
||||
(member_expression
|
||||
object: (this)
|
||||
property: (property_identifier) @local.reference)
|
||||
Loading…
Add table
Add a link
Reference in a new issue