-
Notifications
You must be signed in to change notification settings - Fork 1.1k
MIgrate away from Kotlin Documentable #10660
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
MIgrate away from Kotlin Documentable #10660
Conversation
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.
There's a whole bunch of changes in code areas I'm not familiar with. I don't see anything obviously wrong there, but I don't have the time to try and understand them now, someone else should review this as well.
@@ -28,6 +28,12 @@ type JMap[K, V] = java.util.Map[K, V] | |||
type JHashMap[K, V] = java.util.HashMap[K, V] | |||
type JMapEntry[K, V] = java.util.Map.Entry[K, V] | |||
|
|||
private val emptyListInst = JList() |
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.
Can we preemptively use Collections.emptyList
here? I'd prefer to avoid issues due to some code modifying our "empty" list.
private val emptyListInst = JList() | ||
def JNil[A] = emptyListInst.asInstanceOf[JList[A]] | ||
|
||
private val emptyMapInst = JMap() |
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.
Ditto.
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.
There are some indentations mistakes in ClassLikeSupport
. Otherwise, looks Ok to me
) | ||
|
||
case class TypeParameter( | ||
variance: "" | "+" | "-", |
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.
Why we decide to keep variance explicitly, when bounds are aggregated into Signature
?
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.
variance goes before name and in some cases we would like to refer only to name without variance
|
||
val ext = c.get(ClasslikeExtension) | ||
override def pageForClasslike(c: DClasslike): ClasslikePageNode = ??? |
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.
Maybe we should add more explanatory message why calling this method fails than "Not Implemented"
else Kind.Class(Nil, Nil) | ||
|
||
private def kindForClasslike(classDef: ClassDef): Kind = | ||
def typeArgs = classDef.getTypeParams.map(mkTypeArgument) |
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.
Too deep indentation?
symbol: Symbol, | ||
member: MemberExtension, | ||
compositeExt: CompositeMemberExtension = CompositeMemberExtension.empty): Member = | ||
new DClass( |
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.
I know we will discuss whether dokka will still remain as a base for our doctool, but if dokka stays, we should consider making Member
a subtype od Documentable
, and get rid of these hacks with DClass
wrapper :P
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.
Actually using DClass is really conviniet :)
fbb52ce
to
a7ba826
Compare
3a4a125
to
bb41d4f
Compare
Scala3doc was only loosly using dokka model and it has started to blocking us. This PR standarize over Member and expand semantic of Kind. This allow us to have more typesafe way to reason about code. It will also make migration away from dokka easier if needed.
…r fixes to external location mechanism.
bb41d4f
to
bcaa1a7
Compare
@@ -46,182 +46,163 @@ class ScalaSignatureProvider(contentConverter: CommentsToContentConverter)(using | |||
|
|||
private def stylesIfDeprecated(m: Member): Set[Style] = | |||
if m.deprecated.isDefined then styles ++ Set(TextStyle.Strikethrough) else styles | |||
|
|||
|
|||
|
|||
object ScalaSignatureProvider: | |||
def rawSignature(documentable: Documentable, builder: SignatureBuilder): SignatureBuilder = |
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.
Member?
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.
I will get rid of all Documentable
after this PR is merged
Scala3doc was only loosly using dokka model and it has started to blocking us.
This PR standarize over Member and expand semantic of Kind. This allow us to have more typesafe way to reason about code.
It will also make migration away from dokka easier if needed.
This PR contains #10702 that allow to link to external APIs as well as refactor linking.
Beside that this PR document correctly all members as well as allows to link to given ones.
Signature are rendered correctly (no problem with annotations etc.)