Skip to content

Commit ebc8c46

Browse files
committed
scalafmt
1 parent fbaa706 commit ebc8c46

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/main/scala/com/lightbend/paradox/apidoc/ApidocDirective.scala

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,20 @@ class ApidocDirective(allClassesAndObjects: IndexedSeq[String]) extends InlineDi
5555
if (query.pattern.contains('.')) {
5656
if (allClasses.contains(query.pattern)) {
5757
renderMatches(query, Seq(query.pattern), node, visitor, printer)
58-
} else allClasses.filter(_.contains(query.pattern)) match {
59-
case Seq() =>
60-
// No matches? only then try as regex.
61-
val regex = (query.pattern + "$").r
62-
allClasses.filter(cls => regex.findFirstMatchIn(cls).isDefined) match {
63-
case Seq() =>
64-
throw new java.lang.IllegalStateException(s"Class not found for by @apidoc[$query]")
65-
case results =>
66-
renderMatches(query, results, node, visitor, printer)
67-
}
68-
case results =>
69-
renderMatches(query, results, node, visitor, printer)
70-
}
58+
} else
59+
allClasses.filter(_.contains(query.pattern)) match {
60+
case Seq() =>
61+
// No matches? only then try as regex.
62+
val regex = (query.pattern + "$").r
63+
allClasses.filter(cls => regex.findFirstMatchIn(cls).isDefined) match {
64+
case Seq() =>
65+
throw new java.lang.IllegalStateException(s"Class not found for by @apidoc[$query]")
66+
case results =>
67+
renderMatches(query, results, node, visitor, printer)
68+
}
69+
case results =>
70+
renderMatches(query, results, node, visitor, printer)
71+
}
7172
} else {
7273
renderMatches(query, allClasses.filter(_.endsWith('.' + query.pattern)), node, visitor, printer)
7374
}
@@ -93,7 +94,11 @@ class ApidocDirective(allClassesAndObjects: IndexedSeq[String]) extends InlineDi
9394
)
9495
}
9596

96-
def renderMatches(query: Query, matches: Seq[String], node: DirectiveNode, visitor: Visitor, printer: Printer): Unit = {
97+
def renderMatches(query: Query,
98+
matches: Seq[String],
99+
node: DirectiveNode,
100+
visitor: Visitor,
101+
printer: Printer): Unit = {
97102
val scalaClassSuffix = if (query.linkToObject) "$" else ""
98103

99104
matches.size match {

0 commit comments

Comments
 (0)