Search code examples
fluttervisual-studio-codecommentsshortcut

How to remove all/multiple comments in a Flutter file at once?


How do I remove all the the comments in this file at once ? I don't wanna go line by line and erase all the comments or select an area + backspace multiple times. Is there any shortcut? code with comments

code without comments


Solution

  • I found the solution which doesn't need any extension.

    To remove all the comments together at once using Regular Expression.
    Rejex mode will be enabled by clicking on .* Then in VS Code:

    Press Ctrl + H Press Alt + R //.* Press tab Press Ctrl + Alt + Enter Press Ctrl + S