Repository navigation
Commit efbb732
authored
[ty] Suggest keyword-only arguments between variadic parameters (#26134)
## Summary
Functions with unannotated `*args` and `**kwargs` use a gradual
parameter list. Prior to this change, we omitted all structured
parameters for gradual signatures when building signature help,
including explicit keyword-only parameters retained between the
variadics:
```python
def func(*args, special, **kwargs): ...
func(sp<CURSOR>)
```
This extracts displayed parameters from gradual signatures the same way
we do for standard and `Concatenate` signatures. Pure `(*args,
**kwargs)` signatures still render their parameters as `...` and expose
no concrete parameters, while retained parameters such as `special` are
now available to keyword-argument completion.
The regression test covers both reported shapes, with and without a
positional parameter before `*args`.
Closes astral-sh/ty#3803.1 parent c256d5f commit efbb732
2 files changed
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5127 | 5127 | | |
5128 | 5128 | | |
5129 | 5129 | | |
| 5130 | + | |
| 5131 | + | |
| 5132 | + | |
| 5133 | + | |
| 5134 | + | |
| 5135 | + | |
| 5136 | + | |
| 5137 | + | |
| 5138 | + | |
| 5139 | + | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
| 5143 | + | |
| 5144 | + | |
| 5145 | + | |
| 5146 | + | |
| 5147 | + | |
| 5148 | + | |
| 5149 | + | |
| 5150 | + | |
| 5151 | + | |
| 5152 | + | |
| 5153 | + | |
| 5154 | + | |
| 5155 | + | |
| 5156 | + | |
| 5157 | + | |
| 5158 | + | |
| 5159 | + | |
| 5160 | + | |
| 5161 | + | |
| 5162 | + | |
5130 | 5163 | | |
5131 | 5164 | | |
5132 | 5165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
650 | | - | |
| 650 | + | |
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
| 724 | + | |
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| |||
0 commit comments