Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i comment marked text in Visual Studio 2012 C#? (Not the line)

When i try to comment out some highlighted text (Using the Comment Button at the top of the menu) in C# using Visual Studio 2012, then it comments out the whole line with double slashes. But when i use C++ in the same IDE, then it only comments out the highlighted text, using /* */

Is there VS command/shortcut/button that comments selected text (part of the line) with /*...*/ in C# also?

enter image description here

like image 795
Assassinbeast Avatar asked Oct 16 '13 16:10

Assassinbeast


1 Answers

This does not appear to be a setting you can change in Visual Studio. The documentation for the command the description is:

Marks the current line of code as a comment, using the correct comment syntax for the programming language.

So it would appear that the commenting ability is baked into each language config individually (no relevant settings appear under the Text Editor section specific to a language). Looks like it could have been done easily with Macros, but Macros are no long supported in 2012 :( (help bring them back!)

As the linked SO question suggests, a plug-in/add-in could be developed, but I'm guessing its not worth your time unless you do a lot of that kind of commenting :)

like image 120
Ocelot20 Avatar answered Oct 05 '22 15:10

Ocelot20