Skip to content

Commit

Permalink
FormatWriter: format @usecase tag on one line
Browse files Browse the repository at this point in the history
Apparently, scaladoc doesn't allow newlines for this specific tag.
  • Loading branch information
kitbellew committed Dec 8, 2021
1 parent 0014316 commit a119000
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,14 @@ class FormatWriter(formatOps: FormatOps) {
t.label.foreach(x => sb.append(' ').append(x.syntax))
t.desc.foreach { x =>
val words = x.part.iterator.map(_.syntax)
val tagMargin = getIndentation(2 + margin.length)
// use maxLength to force a newline
iterWords(words, appendBreak, maxLength, tagMargin)
if (t.tag eq Scaladoc.TagType.UseCase)
// scaladoc parser doesn't allow newlines in @usecase
words.foreach(sb.append(' ').append(_))
else {
val tagMargin = getIndentation(2 + margin.length)
// use maxLength to force a newline
iterWords(words, appendBreak, maxLength, tagMargin)
}
}
appendBreak()
case t: Scaladoc.ListBlock =>
Expand Down

0 comments on commit a119000

Please sign in to comment.