VSCode: delete all comments in a file
问题 Is there an easy way to delete all comments from an open file in VSCode? Preferably both line and block comments. Most interested in Java, but also Python and R. 回答1: Easy way: Open extensions (ctrl-shift-x) type in remove comments in the search box. Install the top pick and read instructions. Hard way (I guess) search replace(ctrl-h) toggle regex on (alt-r). Learn some regular expressions! https://docs.rs/regex/0.2.5/regex/#syntax A simple //.* will match all single line comments (and more