Skip to content

fix(lsp): display ** prefix for ParamSpec in hover type parameter lists#3594

Open
aadi-novice wants to merge 1 commit into
facebook:mainfrom
aadi-novice:fix-paramspec-hover-display
Open

fix(lsp): display ** prefix for ParamSpec in hover type parameter lists#3594
aadi-novice wants to merge 1 commit into
facebook:mainfrom
aadi-novice:fix-paramspec-hover-display

Conversation

@aadi-novice
Copy link
Copy Markdown

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

  • quantified.rs: Added ** prefix in Quantified::display_with_bounds() for ParamSpec type parameters, matching Python syntax where ParamSpec is declared as **P.
  • display.rs: Added test test_display_param_spec to 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:

  • Default display: [T, **P, R](self: Any, x: Any, y: Any) -> None
  • LSP hover display: def fooT, **P, R -> None: ...

Fixes #3568

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
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 27, 2026

Hi @aadi-novice!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 27, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label May 27, 2026
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 27, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Copy link
Copy Markdown
Contributor

@kinto0 kinto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! thank you!!

@kinto0 kinto0 self-assigned this May 27, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 27, 2026

@kinto0 has imported this pull request. If you are a Meta employee, you can view this in D106526720.

Copy link
Copy Markdown
Contributor

@yangdanny97 yangdanny97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

paramspec parameter don't show difference in hover

3 participants