Scala Programming Language
  1. Scala Programming Language
  2. SI-4588

Scattered method parameter list with default argument

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Scaladoc Tool
    • Labels:
      None

      Description

      When using default arguments, the method parameter list includes in the browser lots of new lines thus scattering the output. For instance,

      def totalDegree (implicit nodeDegree: DegreeFunction = Degree,
                                degreeFilter: DegreeFilter = AnyDegree): Int
      

      is formatted to

      def totalDegree  (implicit nodeDegree: DegreeFunction =
                         Degree
          , degreeFilter: DegreeFilter =
                         AnyDegree
          ): Int  
      

      Imo the default arguments should be on the same line as =...

        Activity

        Hide
        Rüdiger Keller added a comment -

        This issue is fixed by changing a single rule in the file /scala/tools/nsc/doc/html/resource/lib/template.css.

        Change the rule

        .signature .symbol

        to

        .signature > .symbol

        Show
        Rüdiger Keller added a comment - This issue is fixed by changing a single rule in the file /scala/tools/nsc/doc/html/resource/lib/template.css. Change the rule .signature .symbol to .signature > .symbol
        Hide
        Paul Phillips added a comment -

        r25213.

        Show
        Paul Phillips added a comment - r25213.
        Hide
        Sonnenschein added a comment - - edited

        Sorry, but this issue is not resolved in 2.9.1.RC2.
        Moreover, default values are sometimes not printed at all. You will find a test below.
        Thanks, Peter

        Please check for instance:

        trait Test

        { def even(i: Int) = i % 2 == 0 def max (implicit str : String = "A", flt: Int => Boolean = even) = 100 }

        object Test {
        def from[N](nodeStreams: Seq[List[N]] = Seq.empty[List[N]],
        nodes: Iterable[N] = Seq.empty[N])
        {}
        }

        // "A" and even are placed on new lines
        // default values Seq.empty... are not printed

        Show
        Sonnenschein added a comment - - edited Sorry, but this issue is not resolved in 2.9.1.RC2. Moreover, default values are sometimes not printed at all. You will find a test below. Thanks, Peter Please check for instance: trait Test { def even(i: Int) = i % 2 == 0 def max (implicit str : String = "A", flt: Int => Boolean = even) = 100 } object Test { def from [N] (nodeStreams: Seq[List [N] ] = Seq.empty[List [N] ], nodes: Iterable [N] = Seq.empty [N] ) {} } // "A" and even are placed on new lines // default values Seq.empty... are not printed
        Hide
        Mark Harrah added a comment -

        While I sympathize with the difficulty determining what version contains a given fix, the current practice is to close a bug when fixed in trunk. This fix went into RC3.

        The other issue you mentioned has existed since 2.8.1 and should be a separate bug.

        Show
        Mark Harrah added a comment - While I sympathize with the difficulty determining what version contains a given fix, the current practice is to close a bug when fixed in trunk. This fix went into RC3. The other issue you mentioned has existed since 2.8.1 and should be a separate bug.

          People

          • Assignee:
            Vlad Ureche
            Reporter:
            Sonnenschein
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development