Browse files

1. fixed bug when exportedImports is called recursively

2. correct template is generated in exported-imports scaladoc section.
  • Loading branch information...
1 parent 95dcb73 commit f62a8e8e60896d1a0d9472386f1325a06995d2c8 @rssh committed Dec 1, 2012
View
2 src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -208,7 +208,7 @@ abstract class HtmlPage extends Page { thisPage =>
/** Returns the HTML code that represents exported import in `tpl` as a hyperlinked name. */
def exportedImportToHtml(ei: ExportedImportEntity): NodeSeq =
- typeToHtml(ei.base,true) ++ (ei.selectors map { sel =>
+ templateToHtml(ei.base) ++ (ei.selectors map { sel =>
if (sel.to.nonEmpty)
// todo: make to links to approriative symbols.
<span class="import-selectors">{sel.from} => {sel.to}</span>
View
6 src/compiler/scala/tools/nsc/doc/model/Entity.scala
@@ -640,7 +640,8 @@ trait UpperBoundedTypeParamConstraint extends TypeParamConstraint {
trait ExportedImportEntity extends NonTemplateMemberEntity
{
- def base: TypeEntity
+ //def base: TypeEntity
+ def base: TemplateEntity
def selectors: List[ImportSelectorDoc]
@@ -656,6 +657,9 @@ trait ImportSelectorDoc
/** name of symbol which is imported. "_" in case of wildcard import */
def from: String
+ ///** link to 'from' member (member if we have a name, or base if wildcard */
+ //def fromLink: LinkTo
+
/** imported named if differ from original.
* If name is not changed - empty string */
def to: String
View
4 src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -609,7 +609,9 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
override def isExportedImport = true
- def base: TypeEntity = makeTypeInTemplateContext(sym.base, inTpl, sym)
+ //def base: TypeEntity = makeTypeInTemplateContext(sym.base.underlying, inTpl, sym)
+
+ lazy val base: TemplateEntity = makeTemplate(sym.base.underlying.typeSymbol, Some(inTpl))
def isWildcard: Boolean = sym.selectors.find(_._1==nme.WILDCARD).isDefined
View
11 src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -335,13 +335,24 @@ trait Namers extends MethodSynthesis {
else
(NoSymbol, rtrack)
+ override def exportedImports =
+ if (underlying ne null) {
+ underlying.exportedImports
+ } else {
+ List()
+ }
+
+
+
// the same
override def baseClasses =
if (underlying ne null)
underlying.baseClasses
else
List()
+
+
override def safeToString = "<["+
(if (underlying ne null)
View
4 src/reflect/scala/reflect/internal/Scopes.scala
@@ -333,10 +333,6 @@ trait Scopes extends api.Scopes { self: SymbolTable =>
override def toString(): String = mkString("Scope{\n ", ";\n ", "\n}")
- def implicitImports = lookupAll(nme.IMPORT) flatMap {
- case sym: ImportSymbol if (sym.isImplicit) => Some(sym)
- }
-
}
implicit val ScopeTag = ClassTag[Scope](classOf[Scope])

0 comments on commit f62a8e8

Please sign in to comment.