30

When you define a template, VS 2019 shows a floating pop with the text <T> Provide sample template arguments for Intellisense. You can supply a template type like int, but is there a way to get this floating box to disappear without turning Intellisense off completely?

Example:

template <typename T> // popup box appears here after a few seconds, see image
struct POINT {
    T x, y;
}

Example showing the popup box

AlainD
  • 5,413
  • 6
  • 45
  • 99

1 Answers1

48

This is Visual Studio's template intellisense. If you want its features, then you should click the pencil icon on the right side of the dialog, and provide a sample type for the template. If you don't want the template intellisense features, then you can turn it off in Tools > Options > Text Editor > C/C++ > Advanced > IntelliSense > Enable Template IntelliSense.

Aplet123
  • 33,825
  • 1
  • 29
  • 55
  • 2
    Awesome, that's it! – AlainD Apr 08 '20 at 15:33
  • 8
    why this annoying feature is turned on by default in a first place??? – def Nov 09 '21 at 00:49
  • 1
    This turns off the entire feature, not just the popup. – Glenn Maynard Dec 25 '21 at 12:48
  • 4
    Thank you, this is one of the more annoying UI features in newer VS. It's nice to be able to specialize templates, but when the cost is that you have to click twice (and be very careful where you click) in the code editor to _avoid_ getting a popup, someone has seriously failed at their task of UI testing :P – 1337user Apr 28 '22 at 06:38
  • Very helpful, thanks, and not findable by search box in settings. Also, "Auto Quick Info" = False is a lifesaver with the instant hover popups in VS2022 – risingballs Jan 13 '23 at 07:53
  • Awesome! Really helped! Tried to understand the use of this feature on the official website of VS, but no use. It's a terrible feature because my code was not getting compiled, for no reason. Complete waste of time. Thanks @Aplet123! – Shreekant Aug 06 '23 at 15:39
  • Probably because it _is_ helpful for troubleshooting template code, @def, since it lets IntelliSense instantiate the template with a default set of parameters, without affecting the code itself. Basically, it lets you include default parameters that only IntelliSense (and not actual code) can see, or feed potentially problematic parameters into the IDE to help locate errors within the code. The only problem is that it isn't always collapsed by default; it should _always_ start as a little `` to the right of the template, and only expand if actually clicked on. – Justin Time - Reinstate Monica Aug 25 '23 at 18:37
  • 1
    Template IntelliSense is just for IntelliSense, @Shreekant, it doesn't actually affect compilation. All it does is let you give IntelliSense a set of sample template parameters, so it can use them to examine the template. It's purely an IDE helper and nothing else, basically. – Justin Time - Reinstate Monica Aug 25 '23 at 18:39
  • @JustinTime-ReinstateMonica Thanks for a very concise and useful comment. I understand the purpose must be just to provide an interllisense, which is of course a great feature of VS. And, though it might sound a little weird, in my case it stopped giving a build error, just after turning off the setting. Honestly, I am not sure about the technical reason, why it happened. – Shreekant Aug 31 '23 at 17:50
  • Template IntelliSense affecting a build error like that definitely is weird, @Shreekant, that's for certain; it really isn't _supposed_ to affect anything other than the... I believe it was the IntelliSense database (I'm not too sure of the exact internal mechanics myself, alas). If you can narrow it down any more than that, it might be worth reporting on https://developercommunity.visualstudio.com/VisualStudio , so they can hopefully fix it. – Justin Time - Reinstate Monica Sep 01 '23 at 00:18