Skip to content

Commit 7acfd78

Browse files
committed
Add support for legacy -doc-source-url option
1 parent 11eea8c commit 7acfd78

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ object Scaladoc:
169169
CommentSyntax.default
170170
}
171171
}
172+
val legacySourceLinkList = if legacySourceLink.get.nonEmpty then List(legacySourceLink.get) else Nil
172173
val externalMappings =
173174
externalDocumentationMappings.get.flatMap( s =>
174175
ExternalDocLink.parse(s).fold(left => {
@@ -208,7 +209,7 @@ object Scaladoc:
208209
projectLogo.nonDefault,
209210
projectFooter.nonDefault,
210211
parseSyntax,
211-
sourceLinks.get,
212+
sourceLinks.get ++ legacySourceLinkList,
212213
revision.nonDefault,
213214
externalMappings,
214215
socialLinksParsed,

scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
4141
val sourceLinks: Setting[List[String]] =
4242
MultiStringSetting("-source-links", "sources", SourceLinks.usage)
4343

44+
val legacySourceLink: Setting[String] =
45+
StringSetting("-doc-source-url", "sources", "Legacy option from Scala 2. Use -source-links instead.", "")
46+
4447
val syntax: Setting[String] =
4548
StringSetting("-comment-syntax", "syntax", "Syntax of the comment used", "")
4649

@@ -124,4 +127,4 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
124127
StringSetting("-scastie-configuration", "Scastie configuration", "Additional configuration passed to Scastie in code snippets", "")
125128

126129
def scaladocSpecificSettings: Set[Setting[_]] =
127-
Set(sourceLinks, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, generateInkuire, scastieConfiguration)
130+
Set(sourceLinks, legacySourceLink, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, generateInkuire, scastieConfiguration)

0 commit comments

Comments
 (0)