Show value of readonly/const on hover

I would like to be able to see the assigned value of readonly and const fields/properties/variables when hovering over them with the mouse.  I can't find any setting for this; is it possible?

0
4 comments

You can hover and check the const values in the editor by default. For example:

But for readonly fields or variables, it could be computational properties, you cannot inspect the values in editor.

0

It works for built-ins like Math.PI, but not for my own readonly/constants (regardless of whether they are static or in static classes).  I tried with readonly int and float in various scopes.  What do you mean when you say “you cannot inspect the values in editor”?

0

Constants will not be modified in the code context, thus IDE can provide a preview. 

For variable declaration, the IDE doesn't support preview because it could be a computational property. 

Could you provide me a sample and screenshot of inspecting the constants in your IDE?

0

OK, I see.  It works for const, but not readonly.

0

Please sign in to leave a comment.