-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scala3doc: Add support for annotations in type parameters, add tests for external location providing, minor fixes #10833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
40a66c5
ca4333f
c4742f8
a5d21ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package tests | ||
|
||
package specializedSignature | ||
|
||
import scala.{specialized} | ||
|
||
trait AdditiveMonoid[@specialized(Int, Long, Float, Double) A] | ||
{ | ||
def a: A | ||
= ??? | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package dotty.dokka | ||
|
||
import org.jetbrains.dokka.pages.ContentPage | ||
import org.jetbrains.dokka.pages.PageNode | ||
import org.jetbrains.dokka.pages.RootPageNode | ||
import org.jetbrains.dokka.pages.ModulePage | ||
import org.jetbrains.dokka.pages.ClasslikePageNode | ||
import org.jetbrains.dokka.model.DPackage | ||
import org.jetbrains.dokka.plugability.DokkaContext | ||
import org.jetbrains.dokka.base.resolvers.external._ | ||
import org.jetbrains.dokka.base.resolvers.shared.{ExternalDocumentation => ED, _} | ||
import org.jetbrains.dokka.base.resolvers.local._ | ||
import org.jetbrains.dokka.model.DisplaySourceSet | ||
import dotty.dokka.withNoOrigin | ||
import dotty.dokka.tasty._ | ||
|
||
import scala.collection.JavaConverters._ | ||
import java.nio.file.Paths | ||
import java.nio.file.Path | ||
import scala.util.matching._ | ||
import dotty.dokka.model.api._ | ||
import java.net.URL | ||
import org.junit.{Test} | ||
import org.junit.Assert._ | ||
|
||
import scala.quoted._ | ||
|
||
class ExternalLocationProviderTest: | ||
def createExternalLocationProvider(docURL: String, ext: String, kind: DocumentationKind) = { | ||
val emptyExtDoc = ED( | ||
URL(docURL), | ||
PackageList( | ||
RecognizedLinkFormat.Javadoc1, JSet(), JMap(), URL(docURL) | ||
) | ||
) | ||
ScalaExternalLocationProvider(emptyExtDoc, ext, kind) | ||
} | ||
|
||
def testResolvedLinks(provider: ScalaExternalLocationProvider, testcases: List[(DRI, String)]) = testcases.foreach { | ||
case (dri, expect) => assertEquals(provider.resolve(dri), expect) | ||
} | ||
|
||
@Test | ||
def javadocExternalLocationProviderTest(): Unit = { | ||
val provider = createExternalLocationProvider("https://docs.oracle.com/javase/8/docs/api/", ".html", DocumentationKind.Javadoc) | ||
val testcases = List( | ||
(DRI("java.util.Map$$Entry"), "https://docs.oracle.com/javase/8/docs/api/java/util/Map.Entry.html"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't we add a tests for method base There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm gonna make task for that because linking to methods (anchors) are still TODO There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
(DRI("javax.swing.plaf.nimbus.AbstractRegionPainter$$PaintContext$$CacheMode"), "https://docs.oracle.com/javase/8/docs/api/javax/swing/plaf/nimbus/AbstractRegionPainter.PaintContext.CacheMode.html"), | ||
(DRI("java.lang.CharSequence"), "https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html") | ||
) | ||
testResolvedLinks(provider, testcases) | ||
} | ||
|
||
@Test | ||
def scaladocExternalLocationProviderTest(): Unit = { | ||
val provider = createExternalLocationProvider("https://www.scala-lang.org/api/current/", ".html", DocumentationKind.Scaladoc) | ||
val testcases = List( | ||
(DRI("scala.Predef$"),"https://www.scala-lang.org/api/current/scala/Predef$.html"), | ||
(DRI("scala.util.package$$chaining$"), "https://www.scala-lang.org/api/current/scala/util/package$$chaining$.html"), | ||
(DRI("scala.util.Using$"), "https://www.scala-lang.org/api/current/scala/util/Using$.html"), | ||
(DRI("scala.util.matching.Regex$$Match"), "https://www.scala-lang.org/api/current/scala/util/matching/Regex$$Match.html") | ||
) | ||
testResolvedLinks(provider, testcases) | ||
} | ||
|
||
@Test | ||
def scala3docExternalLocationProviderTest(): Unit = { | ||
val provider = createExternalLocationProvider("https://dotty.epfl.ch/api/", ".html", DocumentationKind.Scala3doc) | ||
val testcases = List( | ||
(DRI("scala.Predef$"),"https://dotty.epfl.ch/api/scala/Predef$.html"), | ||
(DRI("scala.util.package$$chaining$"), "https://dotty.epfl.ch/api/scala/util/package$$chaining$.html"), | ||
(DRI("scala.util.Using$"), "https://dotty.epfl.ch/api/scala/util/Using$.html"), | ||
(DRI("scala.util.matching.Regex$$Match"), "https://dotty.epfl.ch/api/scala/util/matching/Regex$$Match.html") | ||
) | ||
testResolvedLinks(provider, testcases) | ||
} |
Uh oh!
There was an error while loading. Please reload this page.