8000 Fixes the annoying spaces between name, type params and params in ScalaDoc by soc · Pull Request #37 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

Fixes the annoying spaces between name, type params and params in ScalaDoc #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account 8000

Merged
merged 1 commit into from
Dec 6, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixes the annoying spaces between name, type params and params in Sca…
…laDoc.
  • Loading branch information
soc committed Dec 6, 2011
commit 7dd56671c0afbb9e94497a47b99230ce2814fc8d
7 changes: 3 additions & 4 deletions src/compiler/scala/tools/nsc/doc/html/page/Template.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions test/scaladoc/scala/html/HtmlFactoryTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
0