Remove comments from file
Since the problem in this question hasn't received any solutions, I; for documentation and readers' help, am going to present the way I currently do it. The ideal solution has to be one-click and do following
- remove all comments in one click
- restore all comments back in one click
So my less than ideal solution is as follows
Remove all comments
1. use following regexp in find tool to replace all multi-line comments with empty /\*(\*)?(((?!\*/)[\s\S])+)?\*/
2. then use following regexp to replace all single-line comments with empty //.*$
Restore all comments
1. Open VCS > Local History > Show History
and restore to the version with comments.
I'm still hoping to find a true one-click solution.
thanks
Related videos on Youtube
Ejaz
Updated on September 18, 2022Comments
-
Ejaz over 1 year
I'm using PHPStorm and have a very basic problem. I want to remove single/multi/phpdoc comments from my files. I want this process to be one-click and easily undo-able. I've tried looking over the internet and in PHPStorm help but couldn't find any feature like this.
There could be a PHPStorm plugin that performs this function? I've exhausted my resources in trying to find out the answer.
I know I can use regular expression search replace in PHPStorm and other text editors to achieve this but I'm looking for more of a one click do/undo able solution.
Any help will be greatly appreciated.
Thanks
-
Ejaz over 8 yearsThat's how I currently do it.
-
Ejaz over 8 yearsThat serves a different purpose than I've stated in question. I want to remove the comment contents which is different from uncommenting a block and making it part of the code.