Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert JS line comments to spaced block comments in IntelliJ IDEA

I'm working in IntelliJ IDEA cleaning up some Javascript code to match a code style standard.

My goal is to change this:

// A comment
// About some things
// That spans multiple lines

into this:

 /**
  * A comment
  * About some things
  * That spans multiple lines
  */

...without having to manually edit each and every comment block.

I know that IntelliJ has a Comment with Block Comment feature, but when I select a block and use that I can only get it to generate this:

/*A comment
About some things
That spans multiple lines*/

Does IntelliJ support the JSDoc style of comments?

like image 652
bryan kennedy Avatar asked Jan 29 '26 21:01

bryan kennedy


1 Answers

There is no feature in IntelliJ IDEA that could automatically convert an existing sequence of end-of-line comments into a JSDoc comment. To perform such a conversion automatically, you can write a simple plugin, or just write a script that would perform the conversion when invoked from the command line.

like image 57
yole Avatar answered Feb 01 '26 13:02

yole



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!