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 {
1416
1416
.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)
1417
1417
.remove[VersionsDictionaryUrl ]
1418
1418
.add(SourceLinks (List (
1419
- dottySrcLink(referenceVersion , temp.getAbsolutePath + " =" )
1419
+ dottySrcLink(" language-reference-stable " , temp.getAbsolutePath + " =" )
1420
1420
)))
1421
1421
.withTargets(List (" ___fake___.scala" ))
1422
1422
}
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ import java.nio.file.{Path, Paths}
4
4
5
5
case class PathBased [T ](entries : List [PathBased .Entry [T ]], projectRoot : Path ):
6
6
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
11
13
12
14
trait ArgParser [T ]:
13
15
def parse (s : String ): Either [String , T ]
Original file line number Diff line number Diff line change @@ -43,9 +43,7 @@ case class LoadedTemplate(
43
43
def getMap (key : String ) = templateFile.settings.getOrElse(key, Map .empty).asInstanceOf [Map [String , Object ]]
44
44
45
45
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
49
47
ctx.sourceLinks.pathTo(actualPath).map(" viewSource" -> _ ) ++
50
48
ctx.sourceLinks.pathTo(actualPath, operation = " edit" ).map(" editSource" -> _)
51
49
You can’t perform that action at this time.
0 commit comments