开发者

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

开发者 https://www.devze.com 2023-01-05 09:59 出处:网络
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 ?

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.


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


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...


In current Resharper versions you can enable this.

  1. Resharper -> Options -> Settings:

Activate "Color identifiers". Might change your color highlightning colors

  1. Resharper -> Options -> Environment -> Editor -> Editor Appearance -> Tooltip:

Activate "Replace Visual Studio tooltip".

0

精彩评论

暂无评论...
验证码 换一张
取 消