1

I'm really curious if anyone knows if Visual Studio's IntelliSense can be configured to display a code block's declaration by hovering over the block's closing brace (or something similar).

Rather than having to mark long code blocks with a comment, I would much rather hover over the closing brace to view which block it ends.

If what I'm saying isn't clear, imagine you had the code block below:

if (typeof(obj) is Int32)
{
    ///...PROGRAM LOGIC...
}

In this example, if I were to move the caret to the end brace, right-click the end brace, or simply hover over it. A popup window would show giving me the original declaration at the top:

if (typeof(obj) is Int32) { //...


Also, I'm interested to know if this can be done in Eclipse; I've asked that question here.
Community
  • 1
  • 1
Nicholas Miller
  • 4,205
  • 2
  • 39
  • 62

2 Answers2

3

This is now available in Visual Studio 2015.

Jason Malinowski
  • 18,148
  • 1
  • 38
  • 55
  • I'm using Visual Studio 2015, and I'm not seeing it. Can you elaborate? What do I need to configure, etc.? – BrainSlugs83 Jul 03 '16 at 21:29
  • Uh, it should just work. Verify you don't have Resharper or other plugins installed that might be interfering, and then [file a bug](https://github.com/dotnet/roslyn/issues) if it's still not working. I just tried it and it's working on Visual Studio 2015 Update 3 for me. – Jason Malinowski Jul 04 '16 at 01:35
1

Looks like VSCommands for Visual Studio 2013 adds this exact functionality.

VSCommands Closing Brace Visualization

It's in "always on" mode by default (shown above), but personally, I find that annoying and change it to display the icon & tooltip only -- then when you hover over the icon you get a pop-up tooltip like you describe (the rest of the Extension is also very cool, it allows you to right click and compare files, even if they're not under source control, right click -> zip solution, all kinds of cool stuff).

To configure the feature, after installing the extension and restarting Visual Studio, open Tools -> Options -> VSCommands 12 -> Open Configuration. This opens a Configuration page (similar to project settings, etc.)

Tools -> Options -> VSCommands 12 -> Open Configuration

So, close the options dialog at this point and in the Configuration page, find IDE Enhancements -> Text Editor and Check Enable Code Block End Tagger (I also recommend either using Double-Click or Ctrl+Click navigation). Turn off "Show only when block beginning not visible", and then set Display Mode to "Icon Only".

Configuration Screen

And this is what you get (note the mouse cursor is missing in the screen shot, but I'm hovering over the closing brace):

VSCommands with Closing Brace Tooltips

BrainSlugs83
  • 6,214
  • 7
  • 50
  • 56