fix(lsp): display ** prefix for ParamSpec in hover type parameter lists#3594
fix(lsp): display ** prefix for ParamSpec in hover type parameter lists#3594aadi-novice wants to merge 1 commit into
Conversation
When hovering over a generic function that uses ParamSpec (e.g., **P), the type parameter list in the hover was showing [T, P, R] instead of [T, **P, R]. The fix adds a check in Quantified::display_with_bounds() to prepend ** for ParamSpec type parameters in the type parameter list display. Fixes facebook#3568
|
Hi @aadi-novice! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
@kinto0 has imported this pull request. If you are a Meta employee, you can view this in D106526720. |
yangdanny97
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary
When hovering over a generic function that uses ParamSpec (e.g., **P), the type parameter list in the hover was showing [T, P, R] instead of [T, **P, R] - the ** prefix was missing.
Changes
**prefix inQuantified::display_with_bounds()for ParamSpec type parameters, matching Python syntax where ParamSpec is declared as**P.test_display_param_specto verify the fix works in both default and LSP hover display modes.Testing
Added a unit test that creates a generic bound method with type parameters [T, **P, R] and verifies:
Fixes #3568