mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
Add JS/TS parameters again (#1227)
* highlights(js): add parameters * highlights(ts): add Typescript parameters
This commit is contained in:
parent
e8e8c0f0f2
commit
082d2ef6e1
3 changed files with 57 additions and 39 deletions
|
|
@ -1 +1,33 @@
|
|||
; inherits: ecma,jsx
|
||||
|
||||
;;; Parameters
|
||||
(formal_parameters (identifier) @parameter)
|
||||
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @parameter))
|
||||
|
||||
;; ({ a }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @parameter))
|
||||
|
||||
;; ({ a: b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @parameter)))
|
||||
|
||||
;; ([ a ]) => null
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @parameter))
|
||||
|
||||
;; a => null
|
||||
(arrow_function
|
||||
parameter: (identifier) @parameter)
|
||||
|
||||
;; optional parameters
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @parameter))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue