mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(python): add support for typed (kw)args (PEP 484) (#5875)
This commit is contained in:
parent
757b4f6afb
commit
4a4dbe1cb1
1 changed files with 14 additions and 4 deletions
|
|
@ -138,15 +138,25 @@
|
|||
|
||||
; Variadic parameters *args, **kwargs
|
||||
(parameters
|
||||
(list_splat_pattern
|
||||
; *args
|
||||
(list_splat_pattern ; *args
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
(parameters
|
||||
(dictionary_splat_pattern
|
||||
; **kwargs
|
||||
(dictionary_splat_pattern ; **kwargs
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; Typed variadic parameters
|
||||
(parameters
|
||||
(typed_parameter
|
||||
(list_splat_pattern ; *args: type
|
||||
(identifier) @variable.parameter)))
|
||||
|
||||
(parameters
|
||||
(typed_parameter
|
||||
(dictionary_splat_pattern ; *kwargs: type
|
||||
(identifier) @variable.parameter)))
|
||||
|
||||
; Lambda parameters
|
||||
(lambda_parameters
|
||||
(list_splat_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue