Skip to content

Commit

Permalink
Entities nested in a Type Member definition are *not* traversed, beca…
Browse files Browse the repository at this point in the history
…use the Eclipse Java Outline that we currently

use does not handle members defined in a {{{ org.eclipse.jdt.internal.core.SourceField }}} (which is the data structure
we use to expose type members definition to JDT).

For instance, the following is not correctly handled by the Outline when you click on the nested member `a`:

    {{{type AkkaConfig = a.type forSome { val a: AnyRef }.

Hence, for safety, currently it is better to skip all children altogether. Fix #1000748.
  • Loading branch information
dotta committed Nov 16, 2011
1 parent 4a1c311 commit 3bff724
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,15 @@ trait ScalaStructureBuilder extends ScalaAnnotationHelper { pc : ScalaPresentati
(builder.addClass(cd), List(cd.impl))
case md : ModuleDef => (builder.addModule(md), List(md.impl))
case vd : ValDef => (builder.addVal(vd), List(vd.rhs))
case td : TypeDef => (builder.addType(td), List(td.rhs))
case td : TypeDef =>
/* Entities nested in a Type Member definition are *not* traversed, because the Eclipse Java
* Outline that we currently use does not handle members defined in a
* {{{ org.eclipse.jdt.internal.core.SourceField }}} (which is the data structure we use to
* expose type members definition to JDT).
* For instance, the following is not correctly handled by the Outline when you click on the nested
* member `a`: {{{type AkkaConfig = a.type forSome { val a: AnyRef }. Hence, for safety, currently
* it is better to skip all children altogether. */
(builder.addType(td), Nil)
case dd : DefDef =>
if(dd.name != nme.MIXIN_CONSTRUCTOR && (dd.symbol ne NoSymbol))
(builder.addDef(dd), List(dd.tpt, dd.rhs))
Expand All @@ -908,8 +916,7 @@ trait ScalaStructureBuilder extends ScalaAnnotationHelper { pc : ScalaPresentati
case Function(vparams, body) => (builder, Nil)
case _ => (builder, tree.children)
}
}

}
children.foreach {traverse(_, newBuilder)}
if (newBuilder ne builder) newBuilder.complete(this)
}
Expand Down

0 comments on commit 3bff724

Please sign in to comment.