Repository navigation
Fix literal overload completions in call arguments - #10762
Merged
Merged
Conversation
Skip the early return in _tryAddLiterals when inside a function‐call argument so that the call-argument literal completion logic runs and enumerates all Literal[...] overload values.
Collaborator
|
Thanks for the contribution. Since this affects language server functionality, I'll defer to the pylance team. It might be worth adding a test case for this new behavior. Rich Chiodo (@rchiodo), could you or someone else on the pylance team please review this? Thanks! |
This comment has been minimized.
This comment has been minimized.
Author
|
@microsoft-github-policy-service agree |
This comment has been minimized.
This comment has been minimized.
Eric Traut (erictraut)
requested review from
Bill Schnurr (bschnurr) and
Rich Chiodo (rchiodo)
August 30, 2025 19:46
Collaborator
|
Also, this is currently failing CI checks. |
Author
This comment has been minimized.
This comment has been minimized.
|
收到,谢谢您的来信。我将及时回复您!
祝好!
|
Collaborator
|
Rich Chiodo (@rchiodo), are you good with this change? |
Rich Chiodo (rchiodo)
approved these changes
Sep 19, 2025
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: |
Collaborator
|
Eli$ (@el1s7) thanks again for the contribution. Sorry it took so long to get this merged. It will be included in the next release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Skip the early return in
_tryAddLiteralswhen inside a function-call argument so the call-argument literal completion path runs and enumerates allLiteral[...]overload values. Fixes microsoft/pylance-release#4428.Before:
After: