Skip to content

Commit 6756761

Browse files
committed
Fix external location tests
1 parent 7a2b0d6 commit 6756761

File tree

4 files changed

+4
-69
lines changed

4 files changed

+4
-69
lines changed

scala3doc/src/dotty/dokka/tasty/ClassLikeSupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ trait ClassLikeSupport:
244244

245245
def getParentsAsLinkToTypes: List[LinkToType] =
246246
c.getParentsAsTreeSymbolTuples.map {
247-
(tree, symbol) => LinkToType(tree.dokkaType.asSignature, symbol.dri, bareClasslikeKind(symbol))
247+
(tree, symbol) => LinkToType(tree.asSignature, symbol.dri, bareClasslikeKind(symbol))
248248
}
249249

250250
def getParentsAsTreeSymbolTuples: List[(Tree, Symbol)] =

scala3doc/src/dotty/renderers/Locations.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ trait Locations(using ctx: DocContext):
105105

106106
// TODO Add tests for it!
107107
def constructPathForScala3doc(dri: DRI): String =
108-
docURL + dri.asFileLocation + extension + "#" + dri.anchor
108+
val base = docURL + dri.asFileLocation + extension
109+
if dri.anchor.isEmpty then base else base + "#" + dri.anchor
109110

110111
link.kind match {
111112
case DocumentationKind.Javadoc => constructPathForJavadoc(dri)

scala3doc/test/dotty/dokka/ExternalLocationProviderIntegrationTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Scala3docExternalLocationProviderIntegrationTest extends ExternalLocationP
3232
List(".*scala.*::scala3doc::https://dotty.epfl.ch/api/"),
3333
List(
3434
"https://dotty.epfl.ch/api/scala/collection/immutable/Map.html",
35-
"https://dotty.epfl.ch/api/scala/Predef$.html",
35+
"https://dotty.epfl.ch/api/scala/Predef$.html#String",
3636
"https://dotty.epfl.ch/api/scala/util/matching/Regex$$Match.html"
3737
)
3838
)

scala3doc/test/dotty/dokka/ExternalLocationProviderTest.scala

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)