Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added 'exportedImportToHtml' in HtmlPage.

  • Loading branch information...
commit 95dcb73d13510062785375e391d3aa52b7db1949 1 parent 3512e20
Ruslan Shevchenko authored
18 src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -206,6 +206,24 @@ abstract class HtmlPage extends Page { thisPage =>
206 206 case tpl :: tpls => templateToHtml(tpl) ++ sep ++ templatesToHtml(tpls, sep)
207 207 }
208 208
  209 + /** Returns the HTML code that represents exported import in `tpl` as a hyperlinked name. */
  210 + def exportedImportToHtml(ei: ExportedImportEntity): NodeSeq =
  211 + typeToHtml(ei.base,true) ++ (ei.selectors map { sel =>
  212 + if (sel.to.nonEmpty)
  213 + // todo: make to links to approriative symbols.
  214 + <span class="import-selectors">{sel.from} => {sel.to}</span>
  215 + else
  216 + <span class="import-selectors">{sel.from}</span>
  217 + })
  218 +
  219 +
  220 + def exportedImportsToHtml(eiss: List[ExportedImportEntity], sep: NodeSeq): NodeSeq = eiss match {
  221 + case Nil => NodeSeq.Empty
  222 + case ei :: Nil => exportedImportToHtml(ei)
  223 + case ei :: eis => exportedImportToHtml(ei) ++ sep ++ exportedImportsToHtml(eis, sep)
  224 + }
  225 +
  226 +
209 227 /** Returns the _big image name corresponding to the DocTemplate Entity (upper left icon) */
210 228 def docEntityKindToBigImage(ety: DocTemplateEntity) =
211 229 if (ety.isTrait && !ety.companion.isEmpty && ety.companion.get.visibility.isPublic && ety.companion.get.inSource != None) "trait_to_object_big.png"
4 src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -636,12 +636,12 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
636 636 }
637 637
638 638 val exportedImports = mbr match {
  639 + // TODO: get from dtpl fill deep exported imports/
639 640 case dtpl: DocTemplateEntity if isSelf && !isReduced && dtpl.exportedImports.nonEmpty =>
640 641 <div class="toggleContainer block">
641 642 <span class="toggle">Exported Imports</span>
642 643 <div class="exportedImports hiddenContent">{
643   - // !!!
644   - Text(dtpl.exportedImports.toString)
  644 + exportedImportsToHtml(dtpl.exportedImports, sep = scala.xml.Text(", "))
645 645 }</div>
646 646 </div>
647 647 case _ => NodeSeq.Empty

0 comments on commit 95dcb73

Please sign in to comment.
Something went wrong with that request. Please try again.