diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/page/Template.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala | 7 |
2 files changed, 7 insertions, 2 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 8b6564c27c..8185b29246 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -277,7 +277,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage { } ++ { tpl.companion match { case Some(companion) if (isSelf && !isReduced) => - if (companion.visibility.isPublic) { + if (companion.visibility.isPublic && companion.inSource != None) { <div class="block"> go to: <a href={relativeLinkTo(companion)}>companion</a> </div> diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala index a7f22e94ff..5d7b1d1214 100644 --- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala @@ -163,7 +163,12 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory templatesCache += (sym -> this) lazy val definitionName = optimize(inDefinitionTemplates.head.qualifiedName + "." + name) override def toRoot: List[DocTemplateImpl] = this :: inTpl.toRoot - def inSource = if (sym.sourceFile != null) Some((sym.sourceFile, sym.pos.line)) else None + def inSource = + if (sym.sourceFile != null && ! sym.isSynthetic) + Some((sym.sourceFile, sym.pos.line)) + else + None + def sourceUrl = { def fixPath(s: String) = s.replaceAll("\\" + java.io.File.separator, "/") val assumedSourceRoot: String = { |