File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
scaladoc/src/dotty/tools/scaladoc Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1416,7 +1416,7 @@ object Build {
14161416 .add(ProjectVersion (" 3.1.2" )) // TODO: Change that later to the current version tag. (This must happen on first forward this branch to stable release tag)
14171417 .remove[VersionsDictionaryUrl ]
14181418 .add(SourceLinks (List (
1419- dottySrcLink(referenceVersion , temp.getAbsolutePath + " =" )
1419+ dottySrcLink(" language-reference-stable " , temp.getAbsolutePath + " =" )
14201420 )))
14211421 .withTargets(List (" ___fake___.scala" ))
14221422 }
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ import java.nio.file.{Path, Paths}
44
55case class PathBased [T ](entries : List [PathBased .Entry [T ]], projectRoot : Path ):
66 def get (path : Path ): Option [PathBased .Result [T ]] =
7- if path.isAbsolute && path.startsWith(projectRoot) then get(projectRoot.relativize(path))
8- else entries.filter(_.path.forall(p => path.startsWith(p))).maxByOption(_.path.map(_.toString.length)).map(entry =>
9- PathBased .Result (entry.path.fold(path)(_.relativize(path)), entry.elem)
10- )
7+ val paths = Option .when(path.isAbsolute && path.startsWith(projectRoot))(projectRoot.relativize(path)).toSeq :+ path
8+ paths.iterator.to(LazyList ).flatMap { path =>
9+ entries.filter(_.path.forall(p => path.startsWith(p))).maxByOption(_.path.map(_.toString.length)).map(entry =>
10+ PathBased .Result (entry.path.fold(path)(_.relativize(path)), entry.elem)
11+ )
12+ }.headOption
1113
1214trait ArgParser [T ]:
1315 def parse (s : String ): Either [String , T ]
Original file line number Diff line number Diff line change @@ -43,9 +43,7 @@ case class LoadedTemplate(
4343 def getMap (key : String ) = templateFile.settings.getOrElse(key, Map .empty).asInstanceOf [Map [String , Object ]]
4444
4545 val sourceLinks = if ! templateFile.file.exists() then Nil else
46- // TODO (https://github.com/lampepfl/scala3doc/issues/240): configure source root
47- // toRealPath is used to turn symlinks into proper paths
48- val actualPath = Paths .get(" " ).toAbsolutePath.relativize(templateFile.file.toPath.toRealPath())
46+ val actualPath = templateFile.file.toPath
4947 ctx.sourceLinks.pathTo(actualPath).map(" viewSource" -> _ ) ++
5048 ctx.sourceLinks.pathTo(actualPath, operation = " edit" ).map(" editSource" -> _)
5149
You can’t perform that action at this time.
0 commit comments