ARentalTV
ARentalTV

Reputation: 376

How do I make Visual Studio display "auto" types

So, when I use auto keyword in VS2015 with something simple, like this:

As you can see, it shows the variable's type, but, when I try something a bit more complex (or defined in another file?), it freaks out and gives me some not-so-useful information:

Although VS is still able to determine top's type:

So, I wonder if there is a way to make this wonderful IDE show those complex/defined somewhere else types?

Upvotes: 9

Views: 4024

Answers (3)

Kargath
Kargath

Reputation: 528

According to this discussion thread, Microsoft changed the shortcut keys. The relevant settings are here enter image description here

Upvotes: 3

Adam Kuzański
Adam Kuzański

Reputation: 674

vs2022 now supports pressing ctrl twice to display the actual type represented by auto.

If you are using Visual Assist on Visual Studio 2022 double ctrl (mentioned by @Kargath) will not work.

Press Alt + F1 to display the hidden types.

Upvotes: 1

jciloa
jciloa

Reputation: 1127

At our company, we use the Visual Assist extension (not free unfortunately, but understandably). It can find the class for the auto keyword when you choose "Goto implementation" (Alt+G).

Upvotes: 1

Related Questions