Hide XML comments in Visual Studio 2017 (version 15.5.1) - c#

When collapsing the XML comments for methods etc. It used to be that the summary was hidden. As I would like it to be. Then in VS2015 they broke this. I asked a similar question about VS2015 and got a nice workaround here - to use <para>.
The workaround continued working in VS2017 until now. Now I updated to version 15.5.1 and the workaround is broken, (why??...) and I can't find a setting to change that.
Is there one somewhere?

The way XML comments clutter up the code has always bothered me. In the past I've tried a few different Visual Studio Extensions and they've always sucked.
However, I just installed NoComment and it seems to do the job. I'm running Visual Studio 2017 version 15.7.3.
While I was looking for this I came across your question, so I thought I'd provide an answer. Hopefully you'll find it helpful :)

Since NoComment is no longer supported. I found Collapse Comments is the closest extension.
It works perfectly on Visual Studio 2019. It does a similar act of hiding xml comments. With options to hide small (single-line), long (multi-lines), and documentation (xml) comments.
Choose what you want to hide in the toolbar that you will see after installing the extension.
Click on the comment icon to show, click somewhere else and it will auto hide.
Quote of features the listed features by the developer in readme.md
Ctrl+M, Ctrl+C collapses all comments (and using/Import statements)
Ctrl+M, Ctrl+D expands all comments and closes all other areas
Works with C#, VB, and XML comments
Can also collapse (or expand) using/import directives
Can be configured to collapse comments when a document is opened

Related

Visual Studio 2017: C# highlight and surround with parentheses

Is there a way to highlight a piece of code in Visual Studio C# and automatically place a pair of parentheses around the block of code rather than manually put your cursor at the beginning and press '(' and then the end and press ')'?
I've used other IDEs that have had this feature and as simple as it sounds, it's very nice to have.
I'm currently working with Visual Studio 2017.
To my knowledge, Visual Studio doesn't provide that functionality out of the box. However, there are free extensions you can download from the Visual Studio Marketplace that do what you describe such as:
Surround Selection
Selection Wrapper
You can download them from the marketplace using the links above or by searching in visual studio (Menu: Extensions -> Manage Extensions -> perform your search)
Disclaimer I’ve only tried out the first one of these briefly and it appears to work. I will update after checking the second one.
Edit: I've now tried both and both worked. Please note that I use VS2019 so I can't vouch for their performance on VS2017. Of the two options I mentioned, Surround Selection claims to work with VS2017 while the second one only lists VS2019.

Intellisense not working for unit test project in Visual Studio Professional 2017

I'm working on a Visual Studio solution using Visual Studio Professional 2017, the solution consists of four types of projects:
Several C++ projects
A C# project
Several C++ unit test projects
A C# unit test project
IntelliSense seems to be working for all, except for (at least) one of the C++ unit test projects, and it goes even further: for some tests inside that particular C++ unit test project, IntelliSense is working, but for some other, it isn't.
As mentioned in other Stackoverflow posts, I've already removed the *.cache files and there are no *.ncb files (so I can't remove them :-) ).
I also consulted the MSDN website, as proposed by Visual Studio:
Intellisense: 'No additional information available' (See 'Troubleshooting Intellisense in C++ Projects' for further help.)
I typed the mentioned sentence in MSDN search (learn.microsoft.com), and I got 229 results, which looked useless, and I got 0 results while searching for the exact phrase. :-(
Another approach : in my Visual Studio settings, I've maximised the messages, sent to the output window, I've rebuilt the whole solution, and afterwards I looked for the word IntelliSense in the output window. There was nothing. Then I typed something in order to launch IntelliSense, I verified the output window, but nothing was added.
In order to solve this problem, I need detailed information about IntelliSense itself:
I believe that IntelliSense is based on some files. Which ones?
I also believe that IntelliSense is keeping its own information in memory. Is this correct, is there a way to store this memory mapped information in files? If yes, which ones, and how can I force IntelliSense to refresh its information?
Whatever IntelliSense is doing (filling its information in memory, saving it in files, retrieving its information from those files, ...), what can I do in order to log those actions, so that I have an idea what might be going wrong?
In other words, does anybody have background information on the IntelliSense background task, which might explain what's going wrong, and how I can derive (from information in output window or other) what to do?
Thanks in advance
You can try resetting Visual Studio once
Devenv /ResetSettings
Sometimes Visual Studio has these gnawing bugs that just stresses you out for no reason.
Remove the hidden .vs folder from your solution. That would trigger index rebuilding.
Also you can try to install recent update for Visual Studio 2017, they seem to work actively on improving the indexing.

Visual Studio 2015 quick action helpers have disappeared

Until very recently, my copy of Visual Studio 2015 Professional provided a very useful set of features, in particular...
changing the name of a property/method would give a light-bulb icon and the ability to update all instances of those properties/methods
using an unreferenced class/namespace would give a light-bulb icon and the ability to quickly add a using/Imports, along with multiple other options
Here is an example of the 2nd of the above... the light-bulb used to appear just to the left of the popup message.
I cannot find any obvious option that would turn this off.
The issue is happening in both C# and VB.Net projects
I recently had an issue with CodeLens, the solution I found told me to remove the %TEMP%\ALM directory. This fixed the CodeLens, but I'm wondering if it could have effected the light-bulb helpers.
Does anybody know how to get the light-bulb helpers to return?
After updating to VS2015 Update 3 the light-bulb helpers have returned

Visual Studio "document outline" for C# file

In Visual Studio (2013/2015/2017), the Document Outline window for C# files is always empty ("There are no items to show for the selected document.").
It seems that this functionality is not (not yet / no more) implemented.
But then, how do I view the structure of the file? Is there any extension which implements this functionality?
showing only the selected/opened file
show regions
move/rename members
show documentation
Using the Solution Explorer and Class View are NOT the solution.
In the old Visual Studio 2003, I did use a self written Add-In, because it was easy to read the structure. (There were also other tools but I cannot find them anymore). So I ask here which solution you know. :-)
EDIT: Similar question also found:
How to show code outline in Visual Studio?
UPDATE: After 10 years the feature has finally arrived in VS 2022
This feature has been added in Visual Studio 2022 17.4.0:
You can now easily view a file’s structure at a glance in the Document Outline window. The Document Outline window displays the symbol tree of the file in the editor helping you quickly navigate and edit project files. You can open Document Outline by going to View > Other Windows > Document Outline or by using the shortcut Ctrl+Alt+T.
Update: This feature was disabled in v17.4.4 for the following reason:
After we released 17.4, we found some significant performance problems with the C# implementation of Document Outline that we didn’t catch during preview usage. We’ve temporarily disabled the feature, and are spending more time working on it to address these issues. These changes are larger than we’d usually like to include in a revision release, and need more bake time, so 17.4.3 [sic] onwards & 17.5 will both ship with the feature disabled. I know this is disappointing, but we have it back in no time and enabled in a future VS update.
There is also CodeMaid which provides the same functionality as JetBrains Resharper, but is free.
The best solution I found at present is:
JetBrains ReSharper (v8.0+) has a File Structure window which shows the structure of the current file as tree (types/members) and regions are also supported.
If you don´t have ReSharper, you can´t miss the Productivity Power Tools, made by Microsoft itself.
There's a specific version for each of Visual Studio versions. More info on these links:
VS2013
VS2012
VS2010
They have a feature called Solution Navigator
Also, there's this one that seems very interesting for bring alot of cool customizations to Visual Studio IDE, called VSCommands. It's worth to checkout their website => http://vscommands.squaredinfinity.com/features
It helps you look at the nested structure of certain types of files, e.g. windows forms designer file, open a form designer you should see all controls on the form shown in nested structure in the document outline window.

Extend "Tools" window in Visual Studio

I'm looking how to inject my own page into VS2010 Tools->Options window in my open source project. ReSharper, VisualSVN and others are able to add their own page there and it seems like a natural place for settings. Unfortunately I'm not able to find any information or examples and I'm not perfectly familiar with the extension framework (been able so far to add my own tool windows, toolbars, menus etc.)
Any help would be appreciated.
Update: I've just got NuGet source code because they inject tool window too, trying to figure out how.
Check out the Visual Studio Extensibility samples on MSDN Code Gallery. Specifically, you'd be most interested in these:
VSSDK IDE Sample: Options Page
VSSDK IDE Sample: WPF Tool Window
You can find general information on getting started with the Visual Studio SDK here: http://msdn.com/vsx

Categories

Resources