gpt4 book ai didi

Scaladoc 无法为方法和类签名中的内部类生成链接

转载 作者:行者123 更新时间:2023-12-04 15:33:16 26 4
gpt4 key购买 nike

我有一个顶级特征,其中包含许多类和特征,例如:

trait Trees { self: Types =>
trait Tree
trait IdentifiedTree extends Tree
trait Empty extends Tree

/** The factory for [[TypeUse]] instances */
trait TypeUse extends Tree
/** AST tree to represent erroneous trees */
object BadTree extends IdentifiedTree
/** AST tree for empty statements and trees */
val Empty: Empty = new Empty {}
}

trait Types

当我为它生成文档时,使用 scaladoc 我可以使用 [[CLASS_NAME]] 链接到内部类,但是 scaladoc 无法为签名和扩展中的树创建链接。

我使用 sbt 生成 scaladoc,并使用以下标志:
scalacOptions in (Compile, doc) ++= Seq("-groups", "-implicits",
"-diagrams", "-no-prefixes", "-author", "-explaintypes",
"-language:implicitConversions,higherKinds")

为了让您更好地了解,上述定义的 api 如下(请注意缺少的链接):

enter image description here

你能告诉我我做错了什么吗?

最佳答案

我认为嵌套特征的问题在于,内部特征甚至不存在于顶级特征的实例化之外。此 post可能会有一些帮助。

将顶级树更改为对象为我解决了这个问题。但是,我不确定这对您的用例是否有意义。

object Trees {
trait Tree
trait IdentifiedTree extends Tree
trait Empty extends Tree
...
}

关于Scaladoc 无法为方法和类签名中的内部类生成链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30511416/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com