1

Currently when Intellij IDEA autocompletes block comments, e.g. typing /**+<return>, IDEA will create a block comment like so:

/** * Comment goes here */

However, scaladoc recommends that block comment bodies are aligned differently:

/** * Comment here */ (Note the whitespace difference).

How is this configured?

Mycleung
  • 76
  • 6

2 Answers2

1

Intellij 2018.2 supports this now by default.

The setting is at Preferences > Editor > Code Style > Scala > ScalaDoc > Use ScalaDoc indent for leading asterisk.

sourcedelica
  • 23,940
  • 7
  • 66
  • 74
0

I can't see support for this in IntelliJ; I think if it was there, it would be under Preferences > Editor > Code Style > Java > JavaDoc. Even though it says JavaDoc, changing these settings also affects Scala and ScalaDoc code.

I'd recommend using Scalariform to achieve this. Scalariform is a code formatter that will format you code on compile, regardless of what you type into IntelliJ. It has a setting called placeScaladocAsterisksBeneathSecondAsterisk which is exactly what you want.

theon
  • 14,170
  • 5
  • 51
  • 74