-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use the new stdlib when generating scaladoc #23744
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
Conversation
//s"${dottyLibRoot}=markdown", | ||
//s"${stdLibRoot}=wiki", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we cannot have both syntax available in the same sources... for now we just kept the default one until we find a better solution.
//.add(SnippetCompiler(List( | ||
//s"$dottyLibRoot/src/scala=compile", | ||
//s"$dottyLibRoot/src/scala/compiletime=compile", | ||
//s"$dottyLibRoot/src/scala/util=compile", | ||
//s"$dottyLibRoot/src/scala/util/control=compile" | ||
//))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We disable the snippet compiler for now too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When can we turn it back on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we determine the set of packages we need to enable it for.
/** Extracts members while taking Dotty logic for patching the stdlib into account. */ | ||
def extractPatchedMembers: Seq[Member] = { | ||
val ownMembers = c.extractMembers | ||
def extractPatchMembers(sym: Symbol) = { | ||
// NOTE for some reason scala.language$.experimental$ class doesn't show up here, so we manually add the name | ||
val ownMemberDRIs = ownMembers.iterator.map(_.name).toSet + "experimental$" | ||
sym.tree.asInstanceOf[ClassDef] | ||
.membersToDocument.filterNot(m => ownMemberDRIs.contains(m.symbol.name)) | ||
.flatMap(parseMember(c)) | ||
} | ||
c.symbol.fullName match { | ||
case "scala.Predef$" => | ||
ownMembers ++ | ||
extractPatchMembers(qctx.reflect.Symbol.requiredClass("scala.runtime.stdLibPatches.Predef$")) | ||
case "scala.language$" => | ||
ownMembers ++ | ||
extractPatchMembers(qctx.reflect.Symbol.requiredModule("scala.runtime.stdLibPatches.language").moduleClass) | ||
case "scala.language$.experimental$" => | ||
ownMembers ++ | ||
extractPatchMembers(qctx.reflect.Symbol.requiredModule("scala.runtime.stdLibPatches.language.experimental").moduleClass) | ||
case _ => ownMembers | ||
} | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new stdlib doesn't patch anymore, we can remove the logic here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of sbt magic that I'm not sure I fully get, but looks ok to me
//.add(SnippetCompiler(List( | ||
//s"$dottyLibRoot/src/scala=compile", | ||
//s"$dottyLibRoot/src/scala/compiletime=compile", | ||
//s"$dottyLibRoot/src/scala/util=compile", | ||
//s"$dottyLibRoot/src/scala/util/control=compile" | ||
//))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When can we turn it back on?
@@ -3798,13 +3782,8 @@ object ScaladocConfigs { | |||
) | |||
} | |||
|
|||
lazy val DefaultGenerationConfig = Def.task { | |||
def distLocation = (dist / Universal / stage).value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build failed because this had the side effect of being executed (which is obviously an sbt bug and why I removed it) but the CI workflow relies on this buggy effect.
I'm updating the CI workflow file to publish the commands locally before testing.
In this PR, we use the new stdlib project to generate the scaladoc and website of scala 3.
The previous build used
scala2-library-bootstrapped
to fetch have tasty files available. We change this by now using the real, and to be, TASTy files for the stdlib.This changes will already take effect in the first run after the merge of this PR.