Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Free addin or resharper plugin to show constant value in tooltip

Is there a free addin or resharper plugin that will let me see the actual value of a constant value when you hover over a reference to it ?

Since the compiler forces const fields or properties to be a concrete compile-time constant, it is only logical that it show it straight in the tooltip.

eg:

 
   const int DISPLAY_MODE_SIMPLE = 0x02;
   const int DISPLAY_MODE_ADVANCED = 0x04;

   void DoSomething(int displayMode) 
   {
      if (displayMode == DISPLAY_MODE_SIMPLE) {
         ShowSimpleDialog();
      }
   }

I want to hover over DISPLAY_MODE_SIMPLE and see in the tooltip: int MyType.DISPLAY_MODE_SIMPLE = 0x02

I am dealing with a lot of code lately that doesn't use Enums (Java converted with IKVMC), and constantly having to go back and forth when examining old code using it is very irritating.

Neither ReSharper 5 nor Visual Studio 2010 seem to have this feature.

Edit: I am not talking about the debugger. It works with that of course.

like image 433
Raif Atef Avatar asked Jun 30 '10 13:06

Raif Atef


2 Answers

What about using "Code Definition Windows". View -> Code Definition WIndow in Visual Studio?

like image 185
Ivan G. Avatar answered Nov 18 '22 18:11

Ivan G.


When I hover over the DISPLAY_MODE_SIMPLE reference in DoSomething, I see "(constant) int MyType.DISPLAY_MODE_SIMPLE = 2" in the tooltip. This does not appear when I suspend R# 5, so there must be some R# setting that you're not using...

like image 2
bdukes Avatar answered Nov 18 '22 17:11

bdukes