Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent asterisk with Enter is pressed inside C# /* */ comments

In VS2012 C# text editor, when Enter is pressed inside /* */ comments, new line is added, beginning with *. Is it possible to disable this behaviour and get just an empty new line?

From Visual Studio About box, Installed products:

Microsoft Visual Studio Professional 2012
Microsoft Team Explorer for Visual Studio 2012
Microsoft Visual Basic 2012
Microsoft Visual C# 2012
Microsoft Visual C++ 2012
Microsoft Visual F# 2012
Microsoft® Visual Studio® 2012 Code Analysis Spell Checker
NuGet Package Manager
PreEmptive Analytics Visualizer
like image 587
Alex F Avatar asked May 13 '13 09:05

Alex F


1 Answers

It seems like this has annoyed other people for a long time, but as you can see if you read that thread, there is a non-intuitive hack to stop it doing this. You have to set the following option to unchecked:

Text Editor > C# > Advanced > Generate XML documentation comments for ///

Screenshot below:

screenshot

The only downside, is - as the original post says:

Unfortunately, turning this off not only disables the leading asterisk for block comments, but of course also disables the auto-complete feature for XML documentation comments.

like image 79
Roger Rowland Avatar answered Sep 20 '22 00:09

Roger Rowland