How to configured to allow this type of comments by autoformater?
Hello, I use 2 comment styles
1st:
//comment
actual code
code continues
code continues even more
2nd:
// comment
actual code with indent
code continues
code continues even more
// --
1st variant allows me to comment on particular lines or small fragments
2nd variant allows me to easily fold bigger pieces
The problem however is that PHPStorm autoformatter does not allow me to have 2nd variant. And no, i do not want to disable autoformatter, since it does a lot of good things. Maybe there's a way to configure it so it allows such 2nd variant? Thank you!
Please sign in to leave a comment.
Hi there,
AFAIK no. And possibly for good (it better be persistent).
Have you tried using special folding comments in the first place? https://www.jetbrains.com/help/phpstorm/surrounding-blocks-of-code-with-language-constructs.html (at the end).
(you can omit optional bits, like defaultstate)
or these (more closer to your example):
Hmm, not bad, i like the <editor-fold> thing, however - seems i have to type it each time, it doesn't offer autocompletion. How so?
It's just a comment -- plain text.
P.S. If you check the link in my previous comment, there at the end is a screenshot that show how to use "Code | Surround With" to surround selected lines with such folding comments.
Yep, wonderful, that will do! :) Thank you so much !:)