8000 Fixes the annoying spaces between name, type params and params in Sca… · scala/scala@7dd5667 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7dd5667

Browse files
committed
Fixes the annoying spaces between name, type params and params in ScalaDoc.
1 parent 947797e commit 7dd5667

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/compiler/scala/tools/nsc/doc/html/page/Template.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
563563
if (!nameLink.isEmpty)
564564
<a href={nameLink}>{nameHtml}</a>
565565
else nameHtml
566-
}
567-
{
566+
}{
568567
def tparamsToHtml(mbr: Entity): NodeSeq = mbr match {
569568
case hk: HigherKinded =>
570569
val tpss = hk.typeParams
@@ -580,8 +579,8 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
580579
case _ => NodeSeq.Empty
581580
}
582581
tparamsToHtml(mbr)
583-
}
584-
{ if (isReduced) NodeSeq.Empty else {
582+
}{
583+
if (isReduced) NodeSeq.Empty else {
585584
def paramsToHtml(vlsss: List[List[ValueParam]]): NodeSeq = {
586585
def param0(vl: ValueParam): NodeSeq =
587586
// notice the }{ in the next lines, they are necessary to avoid a undesired withspace in output

test/scaladoc/scala/html/HtmlFactoryTest.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ object Test extends Properties("HtmlFactory") {
141141
createTemplate("Trac4372.scala") match {
142142
case node: scala.xml.Node => {
143143
val html = node.toString
144-
html.contains("<span class=\"name\" title=\"gt4s: $plus$colon\">+:</span>\n") &&
145-
html.contains("<span class=\"name\" title=\"gt4s: $minus$colon\">-:</span>\n") &&
144+
html.contains("<span class=\"name\" title=\"gt4s: $plus$colon\">+:</span>") &&
145+
html.contains("<span class=\"name\" title=\"gt4s: $minus$colon\">-:</span>") &&
146146
html.contains("""<span class="params">(<span name="n">n: <span name="scala.Int" class="extype">Int</span></span>)</span><span class="result">: <span name="scala.Int" class="extype">Int</span></span>""")
147147
}
148148
case _ => false
@@ -247,11 +247,11 @@ object Test extends Properties("HtmlFactory") {
247247
val lines = """
248248
|type Bar = AnyRef { type Dingus <: T forSome { type T <: String } }
249249
|type Foo = AnyRef { ... /* 3 definitions in type refinement */ }
250-
|def g (x: T forSome { type T <: String }): String
251-
|def h (x: Float): AnyRef { def quux(x: Int,y: Int): Int }
252-
|def hh (x: Float): AnyRef { def quux(x: Int,y: Int): Int }
253-
|def j (x: Int): Bar
254-
|def k (): AnyRef { type Dingus <: T forSome { type T <: String } }
250+
|def g(x: T forSome { type T <: String }): String
251+
|def h(x: Float): AnyRef { def quux(x: Int,y: Int): Int }
252+
|def hh(x: Float): AnyRef { def quux(x: Int,y: Int): Int }
253+
|def j(x: Int): Bar
254+
|def k(): AnyRef { type Dingus <: T forSome { type T <: String } }
255255
""".stripMargin.trim.lines map (_.trim)
256256

257257
files("RefinementAndExistentials.html") match {

0 commit comments

Comments
 (0)
0