2014-04-20 7 views
7

के लिए स्कालाडॉक लिंक नहीं बना सकता है। मैं स्कालाडॉक के साथ एक समस्या में भाग रहा हूं जिसमें ओवरलोडिंग का उपयोग करते समय एक विधि लिंक स्वीकार नहीं किया जा रहा है।अधिभारित विधि

एक स्वसंपूर्ण उदाहरण: फ़ाइल project/build.properties:

sbt.version=0.13.2 

फ़ाइल build.sbt:

scalaVersion := "2.11.0" 

फ़ाइल src/main/scala/Foo.scala:

package foobar 

/** @see [[Bar#foo]] 
    * @see [[Bar#bar]] 
    */ 
case class Foo() 

abstract class Bar { 
    def foo: Int 

    def bar: Foo 
    def bar(x: Option[Int]): Foo 
} 

जब मैं sbt doc चलाने के लिए, [[Bar#foo]] लिंक ठीक है, लेकिन[[Bar#bar]] लिंक स्वीकार नहीं किया है:

[warn] .../src/main/scala/Foo.scala:3: The link target "Bar#bar" is ambiguous. 
     Several members fit the target: 
[warn] (x: Option[Int]): foobar.Foo in class Bar [chosen] 
[warn] : foobar.Foo in class Bar 
[warn] 
[warn] 
[warn] Quick crash course on using Scaladoc links 
[warn] ========================================== 
[warn] Disambiguating terms and types: Prefix terms with '$' and types with '!' in case both names are in use: 
[warn] - [[scala.collection.immutable.List!.apply class List's apply method]] and 
[warn] - [[scala.collection.immutable.List$.apply object List's apply method]] 
[warn] Disambiguating overloaded members: If a term is overloaded, you can indicate the first part of its signature followed by *: 
[warn] - [[[scala.collection.immutable.List$.fill[A](Int)(⇒A):List[A]* Fill with a single parameter]]] 
[warn] - [[[scala.collection.immutable.List$.fill[A](Int,Int)(⇒A):List[List[A]]* Fill with a two parameters]]] 
[warn] Notes: 
[warn] - you can use any number of matching square brackets to avoid interference with the signature 
[warn] - you can use \\. to escape dots in prefixes (don't forget to use * at the end to match the signature!) 
[warn] - you can use \\# to escape hashes, otherwise they will be considered as delimiters, like dots. 
[warn] /** @see [[Bar#foo]] 
[warn]^
[warn] one warning found 

तो "क्रैश कोर्स" का उपयोग कर, मैं चीजों, जैसे के सभी प्रकार की कोशिश की

[[Bar#bar:Foo*]] 
[[Bar!.bar:Foo*]] 
[[foobar.Bar!.bar:foobar.Foo*]] 

इनमें से कोई भी काम नहीं करता है। न तो अन्य अतिभारित संस्करण का उपयोग कर: तो या तो

[[Bar#bar(Option[Int])]] 
[[Bar#bar(Option[Int]):Foo]] 
[[Bar!.bar(Option[Int]):Foo*]] 

(हमेशा की तरह ...) स्केला-डॉक पूरी तरह से टूट गया है, या मैं कुछ गलत कर रहा हूँ?

उत्तर

3

निम्नलिखित मेरे लिए काम किया। पूरी तरह से योग्य तर्क और वापसी प्रकार का उपयोग करें, जहां \ द्वारा डॉट्स को पूर्ववर्ती किया गया है।

[[Bar#bar:foobar\.Foo* The first bar method without argument]] 
[[Bar#bar(x:Option[Int]):foobar\.Foo* The second bar method with argument]] 
1

मैं के साथ इसे करने की कोशिश:

package foobar 

/** @see [[Bar#foo]] 
    * @see [[Bar!.bar*]] 
    * @see [[[Bar!.bar(x:Option[Int])*]]] 
    */ 
case class Foo() 

abstract class Bar { 
    def foo: Int 

    def bar: Foo 
    def bar(x: Option[Int]): Foo 
} 

और हालांकि मैं एक ही चेतावनी मिलती है, डॉक्स दोनों बार तरीकों के लिंक के साथ उत्पन्न कर रहे हैं।

तो मुझे लगता है कि स्कैला-डॉक पूरी तरह से टूटा हुआ है ... बस थोड़ा कष्टप्रद।

संबंधित मुद्दे