vscode-remove-comments icon indicating copy to clipboard operation
vscode-remove-comments copied to clipboard

Not Removing Comments in code Version: 1.66.0 - in .py files

Open rohan-paul opened this issue 3 years ago • 3 comments

Version: 1.66.0
Commit: e18005f0f1b33c29e81d732535d8c0e47cafb0b5
Date: 2022-03-30T05:50:41.156Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Linux x64 5.13.0-39-generic

rohan-paul avatar Apr 02 '22 16:04 rohan-paul

It looks like this is no longer maintained and it can only handle 1 type of line and block comment.

There is an alternative extensions that removes comments and it should work for .py files: Remove Comments

rioj7 avatar Apr 10 '22 02:04 rioj7

It looks like this is no longer maintained and it can only handle 1 type of line and block comment.

There is an alternative extensions that removes comments and it should work for .py files: Remove Comments

Thanks for the suggestion, and I installed that one, however, even that one seems not to work as expected.

e.g. I have the following python code in .py file. And I just could not delete the multi-line comments using that extension.

def weights_init_normal(m):
    """
    In the example above, we've described the input image in terms of its latent attributes using a single value to describe each attribute. 
    """
    classname = m.__class__.__name__
    if classname.find("Conv") != -1:
        torch.nn.init.normal_(m.weight.data, 0.0, 0.02)
    elif classname.find("BatchNorm2d") != -1:
        torch.nn.init.normal_(m.weight.data, 1.0, 0.02)
        torch.nn.init.constant_(m.bias.data, 0.0)

rohan-paul avatar Apr 10 '22 17:04 rohan-paul

@rohan-paul Because it is not a comment, it is a documentation string, use the # character if you write comments

Python does not have Multi Line comments, """ and ''' are multi line strings

rioj7 avatar Apr 11 '22 16:04 rioj7