-
Notifications
You must be signed in to change notification settings - Fork 764
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
Intellisense still not fully working with Enum classes #4928
Comments
I also noticed this; I am adding all kind of methods to our enums but they don't show up in autocomplete 0_o |
Hi @heejaechang any updates on this? I think giving enums custom methods is a pretty great pattern that I encourage folks to do, but the lack of intellisense makes this tough. many thanks :) |
@heejaechang @fordneild But it is not working. The problem, that the instance of enum must also have this hint |
This issue has been fixed in prerelease version 2024.7.100, which we've just released. You can find the changelog here: CHANGELOG.md |
I believe this may be related to #1905 and #4734.
Environment data
Code Snippet
Repro Steps
Test.X.
Expected behavior
The property
is_x
should be displayed in the suggestions forTest.X.
Actual behavior
Only attributes that are universally applicable to Enum members are displayed (
name
,value
, and the standard sunder/dunder attributes)Even worse, if the Enum class doesn't inherit directly from
enum.Enum
, the suggestions popup is empty (or displaysNo suggestions.
if you try to force the matter withCtrl+Space
). This includes Enums that make use ofenum.IntEnum
or Python 3.11'senum.ReprEnum
andenum.StrEnum
.The example from https://docs.python.org/3/howto/enum.html#planet also fails to produce the attributes created in
__init__
.It should also be noted that all of these attributes added in each of these various ways are correctly understood by the typing system when used, they are simply missing from the provided suggestions.
The text was updated successfully, but these errors were encountered: