Provide better completions when comparing literal #2625
rchl
started this conversation in
Enhancement
Replies: 2 comments
-
Since this enhancement request is a language service feature rather than a core type checking feature, I'm going to transfer it to the pylance repo. It will get the appropriate discussion and consideration there. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
It would be nice if pyright would provide completions in a comparison expression if one side has literal value(s).
An example will best describe my feature request:
Describe the solution you'd like
When on the last line, after the
==
operator, triggering completions could bring up completions for'cola'
and'pepsi'
.This would just speed up writing and make it clear what the value can be compared to.
Additional context
I found microsoft/pyright#335 which is very similar and was implemented but it doesn't work in that context.
(Also the comparison operator could raise a notice if the compared operands don't have any type in common as then the comparison should never result in
True
but it seems like a completely separate feature request.)Beta Was this translation helpful? Give feedback.
All reactions