Ashkru
Ashkru

Reputation: 1635

Resharper: Removing all comments

I just wondered if there was an option in visual studio's extension Resharper to remove all comments and summarys in the solution? I can't find an option anywhere for this, or is there any other kind of tool that does this?

I have tried googling support for this but unfortunately not many people want to do this where as I do.

I use visual studio 2017 if you was wondering.

So, I want this code:

/// <summary>Some method
/// <para>something else...</para>
/// <seealso cref="TestClass.Main"/>
/// </summary>
public void OnCall(string someString)
{
    // Some comment
    // Another comment
    Console.WriteLine(someString.Split(':')[4]);
}

To become this:

public void OnCall(string someString)
{
    Console.WriteLine(someString.Split(':')[4]);
}

I would also like to do the same with #region's if I could, any help would be appreciated.

Upvotes: 1

Views: 3035

Answers (2)

Piers Myers
Piers Myers

Reputation: 10897

Try the CommentRemover extension for Visual Studio 2015/2017

Upvotes: 3

klashar
klashar

Reputation: 2563

I guess this is not commonly used feature. Resharper doesn't have one for sure.

How about running VS "find and replace" feature with regexp that will cover your need? Like this one: "//.+$"

Upvotes: 0

Related Questions