Non-member attributes of enum should be included in completion suggestions #5744
lambda674
started this conversation in
Enhancement
Replies: 2 comments
-
Changing this from a bug to an enhancement request. Enums require a bunch of special-case handling. This use case is pretty esoteric, so it's not clear whether it's worth the effort to add this special-case logic to the completion provider. I'll let the pylance team decide whether they want to invest in this. Could someone from the pylance team please transfer this feature request to the pylance-release project? @rchiodo, @debonte |
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
-
It's possible to define a non member attribute that is recognized with Pyright:
But when I use Pyright LSP in Neovim, I don't see
other_val
as a property underMyEnum.ONE
(let me know if there's a way to show an example or describe this better). The onlyProperty
I see arename
,value
, and__class__
. The reason this matters is that I don't get autocomplete for non member attributes, even though Pyright is aware of the attribute.I've tried using a stub file without success (including trying to use a property function):
I've seen the recommendation that using a property would probably be better so I tried that, but still no success (I would prefer the first implementation but this one is fine):
Versions
pyright: 1.1.357
Python: 3.10.13
Beta Was this translation helpful? Give feedback.
All reactions