summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2011-12-02 12:01:27 +0100
committerSimon Ochsenreither <simon@ochsenreither.de>2011-12-06 23:33:40 +0100
commit7dd56671c0afbb9e94497a47b99230ce2814fc8d (patch)
tree3da53337ef95062a4b6bf371e71e1fdeadbad1c9
parent947797ea23d711e501605c0cc218fec88e3b97ef (diff)
downloadscala-7dd56671c0afbb9e94497a47b99230ce2814fc8d.tar.gz
scala-7dd56671c0afbb9e94497a47b99230ce2814fc8d.tar.bz2
scala-7dd56671c0afbb9e94497a47b99230ce2814fc8d.zip
Fixes the annoying spaces between name, type params and params in ScalaDoc.
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/page/Template.scala7
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala14
2 files changed, 10 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
index 813958af85..5e5320ca9a 100644
--- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -563,8 +563,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
if (!nameLink.isEmpty)
<a href={nameLink}>{nameHtml}</a>
else nameHtml
- }
- {
+ }{
def tparamsToHtml(mbr: Entity): NodeSeq = mbr match {
case hk: HigherKinded =>
val tpss = hk.typeParams
@@ -580,8 +579,8 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
case _ => NodeSeq.Empty
}
tparamsToHtml(mbr)
- }
- { if (isReduced) NodeSeq.Empty else {
+ }{
+ if (isReduced) NodeSeq.Empty else {
def paramsToHtml(vlsss: List[List[ValueParam]]): NodeSeq = {
def param0(vl: ValueParam): NodeSeq =
// notice the }{ in the next lines, they are necessary to avoid a undesired withspace in output
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index adad3b6053..c8dad4cf48 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -141,8 +141,8 @@ object Test extends Properties("HtmlFactory") {
createTemplate("Trac4372.scala") match {
case node: scala.xml.Node => {
val html = node.toString
- html.contains("<span class=\"name\" title=\"gt4s: $plus$colon\">+:</span>\n") &&
- html.contains("<span class=\"name\" title=\"gt4s: $minus$colon\">-:</span>\n") &&
+ html.contains("<span class=\"name\" title=\"gt4s: $plus$colon\">+:</span>") &&
+ html.contains("<span class=\"name\" title=\"gt4s: $minus$colon\">-:</span>") &&
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>""")
}
case _ => false
@@ -247,11 +247,11 @@ object Test extends Properties("HtmlFactory") {
val lines = """
|type Bar = AnyRef { type Dingus <: T forSome { type T <: String } }
|type Foo = AnyRef { ... /* 3 definitions in type refinement */ }
- |def g (x: T forSome { type T <: String }): String
- |def h (x: Float): AnyRef { def quux(x: Int,y: Int): Int }
- |def hh (x: Float): AnyRef { def quux(x: Int,y: Int): Int }
- |def j (x: Int): Bar
- |def k (): AnyRef { type Dingus <: T forSome { type T <: String } }
+ |def g(x: T forSome { type T <: String }): String
+ |def h(x: Float): AnyRef { def quux(x: Int,y: Int): Int }
+ |def hh(x: Float): AnyRef { def quux(x: Int,y: Int): Int }
+ |def j(x: Int): Bar
+ |def k(): AnyRef { type Dingus <: T forSome { type T <: String } }
""".stripMargin.trim.lines map (_.trim)
files("RefinementAndExistentials.html") match {