plibither8 / vscode-remove-comments

🚫 VS Code extension to remove all comments from your code at once — 60+ languages supported
https://marketplace.visualstudio.com/items?itemName=plibither8.remove-comments
MIT License
36 stars 13 forks source link

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

Open rohan-paul opened 2 years ago

rohan-paul commented 2 years ago
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
rioj7 commented 2 years ago

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

rohan-paul commented 2 years ago

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)
rioj7 commented 2 years ago

@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