-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for anchors to old scaladoc and javadoc #11564
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
7a3f839
to
ac6acf7
Compare
private def transformType(tpe: TypeRepr): String = tpe.simplified match { | ||
case AppliedType(tpe, typeList) if tpe.show == "scala.Array" => transformType(typeList.head) + ":A" | ||
case AppliedType(tpe, typeList) if tpe.show == "scala.<repeated>" => transformType(typeList.head) + "..." | ||
case AppliedType(tpe, typeList) => transformPrimitiveType(tpe.show) |
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 compare symbols or types here? Output of show
is not guaranteed to be stable.
import q.reflect._ | ||
import dotty.tools.dotc | ||
given ctx: dotc.core.Contexts.Context = q.asInstanceOf[scala.quoted.runtime.impl.QuotesImpl].ctx | ||
val csym = sym.asInstanceOf[dotc.core.Symbols.Symbol] | ||
Option(csym.associatedFile).fold("")(_.path) | ||
Option(csym.associatedFile).map(_.path).flatMap( path => |
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.
Did you notice any slowdown after these changes? especially this line may affect performance so we may consider caching (this needs to be tested with scala 3 doc not, the self
one)
val originPath = { | ||
val className = sym.className | ||
|
||
val location = className.fold(sym.packageName)(cn => s"${sym.packageName}.${cn}") |
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 think we can work with Seq[Sring] rather then concatenate and then split it later on in each branch
e82ffcd
to
d60bf45
Compare
closes #11085