Skip to content

Commit 5f88058

Browse files
authored
Merge pull request #11714 from lampepfl/scaladoc/sourcelinks-icons
Scaladoc: Add source links to dotty library. Add icons to givens
2 parents 457b207 + 4691607 commit 5f88058

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

project/Build.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,11 @@ object Build {
16141614
val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize())
16151615
val docRootFile = stdLibRoot.resolve("rootdoc.txt")
16161616

1617+
val dottyManagesSources =
1618+
(`stdlib-bootstrapped`/Compile/sourceManaged).value / "dotty-library-src"
1619+
1620+
val dottyLibRoot = projectRoot.relativize(dottyManagesSources.toPath.normalize())
1621+
16171622
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
16181623
else Def.task{
16191624
IO.write(dest / "versions" / "latest-nightly-base", majorVersion)
@@ -1641,6 +1646,7 @@ object Build {
16411646
"gitter::https://gitter.im/scala/scala," +
16421647
"twitter::https://twitter.com/scala_lang",
16431648
s"-source-links:" +
1649+
s"$dottyLibRoot=github://lampepfl/dotty/master#library/src," +
16441650
s"$stdLibRoot=github://scala/scala/v${stdlibVersion(Bootstrapped)}#src/library," +
16451651
s"docs=github://lampepfl/dotty/master#docs",
16461652
"-doc-root-content", docRootFile.toString,

scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx
141141
)
142142

143143
private def buildNavigation(pageLink: Link): AppliedTag =
144-
def navigationIcon(member: Member) = member.kind match {
145-
case m if m.isInstanceOf[Classlike] => Seq(span(cls := s"micon ${member.kind.name.head}"))
144+
def navigationIcon(member: Member) = member match {
145+
case m if m.needsOwnPage => Seq(span(cls := s"micon ${member.kind.name.head}"))
146146
case _ => Nil
147147
}
148148

0 commit comments

Comments
 (0)