-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature: show values of constants #8497
Comments
We also kind of need this to handle at least array sizes, if not full const generics. |
array sizes: #8799, in a limited way ;) |
How close is Thanks in advance! |
We currently parse numeric literals for the purposes of array sizes. Adding a basic expression evaluator is probably not very hard with the infrastructure we have now. I'm not sure the exact code paths to hook it up to display in the IDE but I doubt it would be super hard either. My guess is that implementing some form of constant value evaluation is O(1 day) of work. |
Nice! Thanks for your time and effort! |
I would find it really cool and useful if RA could tell me the values of numeric constants. I don't need a super fancy evaluation, even just an MVP that handles math operators would be absolutely rad.
The thing I would love to use this for is for double checking the hex value of bit hacks I've done to generate the right value, e.g.
const TOP: usize = !0 & !(!0 >> 1);
. Currently I either have to tab out of my editor to stuff it into another rust project or the playground, or just hope I got it right.The text was updated successfully, but these errors were encountered: