2014-01-28 159 views
3

我可以通過指定隱式轉換來將scaladoc配置爲包含來自隱式轉換的方法嗎?配置scaladoc以包含擴展方法

E.g.鑑於

trait Foo 

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

我可以scaladoc包括Foo的文檔擴展方法bar

回答

0

看起來是這樣(我還沒有嘗試過呢):

% 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) 
    ... 
+0

感謝。這適用於默認範圍內的隱式轉換,例如在「Foo」所在的包對象中。但是,它不包含必須導入的任何豐富內容,例如示例中的「操作」。我不知道是否有更多的技巧來實現這個目標? –

+0

我也不知道,但可能不是? –

+0

你試過'-implicits-show-all'嗎? –

相關問題