-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No autocomplete for Literal for __getitem__ #1318
Comments
@bschnurr is this the bug you had noticed? @kumaraditya303 If you switch your type checking mode up, do you see the literal completions working? I believe there's a bug there, but it'd be helpful to check. |
@jakebailey Nope there isn't any autocomplete for literals |
This isn't a bug. It's a feature request. It's technically possible for us to add completion suggestions for the case where a The amount of code to support this is not huge, but it's also not trivial. We could leave this issue open to see if others upvote it. |
Yes, I was confusing this with function argument literal completion, which does have a bug at the moment. |
The pyright correctly identifies the type and also reports error if the value of key in not a matching literal, also if you want to support this then make sure this works for all the functions of the object protocol |
They are plenty of use cases for this, the common one for |
This issue has been fixed in version 2022.1.1, which we've just released. You can find the changelog here: CHANGELOG.md |
Environment data
Expected behaviour
It should show autocomplete for
__getitem__
Actual behaviour
No autocomplete for
__getitem__
Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: