2

If I'm typing a very long comment over line comments, how can I get Webstorm (et al.) to rearrange the comments automatically into a paragraph that neatly lines up? Note that I'm not asking for block comments, although if a solution exists for block comments but not line comments, I'm also interested.

If you're familiar with text editors, I basically want what M-q does in emacs or gq does in vim.

My question is not this question: Php Storm : How can i automate breaking lines in PHPStorm 2.1

Community
  • 1
  • 1
Andrew Mao
  • 35,740
  • 23
  • 143
  • 224

1 Answers1

3

There is no internal API available on whole IDEA platform to do such things (reformat/warp comments while still keeping them as comments and not just brand new line), unfortunately.

Hopefully it will be available in one of the future versions. Devs already working on it -- see this comment for example: http://youtrack.jetbrains.com/issue/WEB-5653#comment=27-758067


On another hand -- please try Wrap to Column plugin -- it does the job with both line and block comments (just checked for PHP code (line and block) and JavaScript (line)).

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • 1
    No joke, that plugin's description is exactly my question: Wrap selected text to the specified column width. Similar to the Emacs command 'Fill Paragraph' and Vim's `gq` (format lines) command. A replacement for the native Intellij Fill Paragraph command, which hasn't ever worked correctly for me. – Andrew Mao Jun 27 '14 at 16:44