gpt4 book ai didi

scala - 配置 scaladoc 以包含扩展方法

转载 作者:行者123 更新时间:2023-12-01 22:41:54 25 4
gpt4 key购买 nike

我可以通过指定隐式转换来配置 scaladoc 以包含隐式转换中的方法吗?

例如给定

trait Foo

object Operations {
implicit class FooOps(val f: Foo) extends AnyVal {
def bar = 33
}
}

我可以让 scaladoc 在 Foo 的文档中包含扩展方法 bar 吗?

最佳答案

看起来是这样(我还没有尝试过):

% scladoc -help
Usage: scaladoc <options> <source files>
where possible scaladoc options include:
...
-implicits Document members inherited by implicit conversions.
-implicits-hide:<implicit(s)> Hide the members inherited by the given comma separated, fully qualified implicit conversions. Add dot (.) to include default conversions.
-implicits-show-all Show members inherited by implicit conversions that are impossible in the default scope. (for example conversions that require Numeric[String] to be in scope)
...

关于scala - 配置 scaladoc 以包含扩展方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21406207/

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