Git Product home page Git Product logo

commentremover's Introduction

Comment Remover

Build status

Download this extension from the VS Gallery or get the CI build.


Remove all comments in any file with a click of a button. Can also remove #regions and preserve XML Doc comments.

See the changelog for changes and roadmap.

Features

  1. Remove all comments in a document
  2. Remove all XML Doc comments
  • Example /// <summary>
  1. Remove all except XML Doc comments
  2. Remove all task comments
  • Example // TODO: fix this
  1. Remove all except task comments
  2. Remove #regions

Find the commands in the Edit top level menu.

Top level menu

Examples

Here are some examples of before and after the comments have been removed

JSON

Before:

{
	// Single-line comment
	"foo": {
		/*
		multi
        line
        comment
		*/
		"prop": 12
	}
}

After:

{
	"foo": {
		"prop": 12
	}
}

CSharp

Before:

/// <summary>
/// Foo bar
/// </summary>
public class Class1
{
    /*
    multi
    line
    comment
    */
    void Hat()
    {
        //single-line comment 
        for (int i = 0; i < 10; i++)
        {
            System.Diagnostics.Debug.Write(i); // same-line comment
        }
    }
}

After:

public class Class1
{
    void Hat()
    {
        for (int i = 0; i < 10; i++)
        {
            System.Diagnostics.Debug.Write(i);   
        }
    }
}   

Contribute

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

License

Apache 2.0

commentremover's People

Contributors

gtrucollo avatar madskristensen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

commentremover's Issues

Feature request - add "remove _empty_ XML doc comments"

I tend to just use the Summary and Remarks tags for Intellisense but typing /// generates empty entries for all the parameters and the return type. I notice this extension can remove XML comments and looking at the code it seems it ought to be relatively straightforward to add an option to ensure that it only removes empty comments.

I.e I'd like a command to transform

///<summary>This is my method</summary>
///<remarks>It's not very interesting</remarks>
///<param name="foo"></param>
/// <returns></returns>

to

///<summary>This is my method</summary>
///<remarks>It's not very interesting</remarks>

I'd be happy to raise a PR but struggling with understanding how to build and test the extension - I get build errors for missing IComponentModel and ComponentModelHost when trying to build under VS2019 Preview.

Some comments are not completely removed

Installed product versions

  • Visual Studio: 2019 Enterprise
  • This extension: 1.3.25

Example

Original:

/// <reference path="jquery.js" />
/** 
  @argument 
 */

After running the tool:

<reference path="jquery.js" />

  @ 

Bug report: Some comments are not completely removed

<!-- 
This is the file that defines the actual layout and type of the commands. It is divided in different
sections (e.g. command definition, command placement, ...), with each defining a specific set of properties.
See the comment before each section for more details about how to use it.
     -->

Just like the comments above in xml, cannot completely removed.

Comment menu option is not there after installing CommentRemover

Installed product versions

  • Visual Studio: [example 2019 Professional]
  • This extension: [example 1.3.25]

Description

Even after CommentRemover is installed and showing in manage extensions I am not able to see the Edit > Comments menu option or use the shortcut.
I tried installing and uninstalling CommentRemover multiple times both from the marketplace and from https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CommentRemover but nothing works

I would love to use this as I'm working on a project with thousands of lines of commented out code and I'm trying to improve it.

Steps to recreate

Plugins I have:

Live share
P4VS - Helix Plugin for visual studio
Incredibuild build acceleration
Test adapter for Google Test
Test adapter for Boost.Test
PreEmptive Protection - Dotfuscator Community
Python - C++ project debugging suppoty
Developer Analytics Tools
Visual Studio IntelliCode
Microsoft Library Manager

  1. Install Comment Remover
  2. Restart Visual Studio 2019
  3. Click Edit

Current behavior

Comment menu option is not there

Expected behavior

Comments menu option is there

SUGGESTION: missing /* */ option

hi, i really like your extension, but missing one more option. Would be nice to use /* ... */ as well.

  • Remove all multiline comments -- Example /* line1 ... line2 ... line n */
  • Remove all except multiline comments

cheers
kK (VS2019 Community)

Comment Remover opens Configure Code Cleanup when CTRL K,Q is pressed

Installed product versions

  • Visual Studio: Visual Studio 2019 Community 16.0.2
  • This extension: 1.3.25

Description

This was one of my favorite Extensions in Visual Studio 2017, and I recently started working on updating my apps with Visual Studio 2019. However, in Visual Studio 2019, CTRL K,Q (which is what I used in Visual Studio 2017 for this Extension), is opening the Configure Code Cleanup window. This is a feature that I am new to, but since all I want right now is to remove the comments (I don't want to do anything complex), I don't want to worry about the fancy configuration of Code Cleanup. What do you suggest?

Steps to recreate

  1. Install Comment Remover Extension in Visual Studio 2019
  2. Open file containing comments
  3. Press CTRL K,Q

Current behavior

CTRL K,Q is opening the Configure Code Cleanup window

Expected behavior

CTRL K,Q should execute Comment Remover to remove comments

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.