WebStorm PhpStorm codeformat: how to fix comments?
WebStorm and PhpStorm allow you to reformat your code to match the coding style set in the settings (ex: indent space)
I use this measure to fix some of the many lint errors in my project, but I am stuck at one point: can all comments be reformatted //
to start with a space? To go from
//My comment
to
// My comment
If the comment already starts with a space character, you should leave it alone.
Edit: there is an option:
- "Settings -> Editor -> Code Style -> {{coding lang}} -> Other Tab" to set a blank space at the beginning of each comment (see the "Comment Code at the bottom of this image).
However, even with selected, using the Convert Code option does not correct comments.
+3
source to share