Skip to content

Commit 58b59a5

Browse files
authored
Merge pull request #14725 from dotty-staging/scaladoc/comment-syntax-fix
Fix picking default syntax for comments
2 parents 6ae7291 + e3f81bc commit 58b59a5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

project/Build.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,8 @@ object ScaladocConfigs {
18391839
.add(DocRootContent(docRootFile.toString))
18401840
.add(CommentSyntax(List(
18411841
s"${dottyLibRoot}=markdown",
1842-
s"${stdLibRoot}=wiki"
1842+
s"${stdLibRoot}=wiki",
1843+
"wiki"
18431844
)))
18441845
.add(VersionsDictionaryUrl("https://scala-lang.org/api/versions.json"))
18451846
.add(DocumentSyntheticTypes(true))

scaladoc/src/dotty/tools/scaladoc/tasty/comments/CommentSyntaxArgs.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ object CommentSyntax:
1717
val default = CommentSyntax.Markdown
1818

1919
case class CommentSyntaxArgs(csFormats: PathBased[CommentSyntax]):
20+
val defaultSyntax = csFormats.get(csFormats.projectRoot)
21+
.map(_.elem)
22+
.getOrElse(CommentSyntax.default)
23+
2024
def get(path: Option[Path]): CommentSyntax =
2125
path
2226
.flatMap(p => csFormats.get(p).map(_.elem))
23-
.getOrElse(CommentSyntax.default)
27+
.getOrElse(defaultSyntax)
2428

2529
object CommentSyntaxArgs:
2630
val usage =
@@ -52,4 +56,4 @@ object CommentSyntaxArgs:
5256
)
5357
CommentSyntaxArgs(res)
5458
}
55-
}
59+
}

0 commit comments

Comments
 (0)