See var Type in Visual Studio

Is there any way to see var type in Visual Studio 2013 code editor?

When I have a crazy linq , it would be nice to see what the resulting type will be. I do not want to replace the var keyword with the actual type, I just want to see what it is.

+5
source share
7 answers

You can get it by hovering over a specific var keyword.

For example, see below the image in the tooltip shows the details.

enter image description here

+8
source

There is also a keyboard shortcut that will show you. Hover over var and type:

ctrl + k , i

enter image description here

+11
source

Hover over the var keyword, it will show it in tootlip.

+2
source

Hover over the var keyword, a tooltip will show you the actual type.

+1
source

Hover over a variable ... This will tell you.

+1
source

Type text can often be obtained (using copy and paste) by temporarily changing var to an explicit type, say int . This will result in a compilation error. After the Build Solution is completed, the type of the variable should be written to both the Error List and the Output .

+1
source

Add a variable watch. Check the type in the viewport.

0
source

Source: https://habr.com/ru/post/1203776/


All Articles