Skip to content
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

Display the value of enum variants on hover #12955

Closed
OleStrohm opened this issue Aug 6, 2022 · 1 comment · Fixed by #12966
Closed

Display the value of enum variants on hover #12955

OleStrohm opened this issue Aug 6, 2022 · 1 comment · Fixed by #12966
Assignees

Comments

@OleStrohm
Copy link
Contributor

OleStrohm commented Aug 6, 2022

I've been wanting this feature, and so I've been working on it, and I've got something working, though it still requires a fair bit more work, but just to have a space for feedback I'm making this issue.

The feature I want is to be able to have an enum like

enum E {
    A = 5,
    B = 1 << 3,
}

which should display something like A = 5 or B = 8.
When hovering on E::A it currently just displays A, which isn't very useful.

Currently consts like const C: u8 = 1 << 8; have this feature, and I think it would make a lot of sense to bring similar feature parity to enum variants.

This requires both updating the hover rendering of enum variants, but the bigger task is to provide proper const evaluation support, which I am currently working on implementing.

@OleStrohm
Copy link
Contributor Author

OleStrohm commented Aug 6, 2022

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant