diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-10-28 17:41:51 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-10-28 17:41:51 +0000 |
commit | 460edf36cb9e19ceea58dcce0cc4c9d6c5b234ac (patch) | |
tree | ba526ce40959a7cfd216b6f4202d4d0c349f4bae /src | |
parent | 9f3d7b709e98f8ee743013a812888232eabb2ab0 (diff) | |
download | scala-460edf36cb9e19ceea58dcce0cc4c9d6c5b234ac.tar.gz scala-460edf36cb9e19ceea58dcce0cc4c9d6c5b234ac.tar.bz2 scala-460edf36cb9e19ceea58dcce0cc4c9d6c5b234ac.zip |
Correctly find completion proposals for ImportT...
Correctly find completion proposals for ImportType. review by odersky
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 6bd7e17e9b..a31e3331c3 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -537,24 +537,28 @@ self => !sym.name.toString.contains("$") val pre = stabilizedType(tree) - val ownerTpe = if (tree.tpe != null) tree.tpe else pre + val ownerTpe = tree.tpe match { + case analyzer.ImportType(expr) => expr.tpe + case null => pre + case _ => tree.tpe + } for (sym <- ownerTpe.decls if shouldDisplay(sym)) addTypeMember(sym, pre, false, NoSymbol) + members.values.toList #:: { + for (sym <- ownerTpe.members if shouldDisplay(sym)) + addTypeMember(sym, pre, true, NoSymbol) members.values.toList #:: { - for (sym <- ownerTpe.members if shouldDisplay(sym)) - addTypeMember(sym, pre, true, NoSymbol) - members.values.toList #:: { - val applicableViews: List[SearchResult] = - new ImplicitSearch(tree, functionType(List(ownerTpe), AnyClass.tpe), isView = true, context.makeImplicit(reportAmbiguousErrors = false)) - .allImplicits - for (view <- applicableViews) { - val vtree = viewApply(view) - val vpre = stabilizedType(vtree) - for (sym <- vtree.tpe.members) { - addTypeMember(sym, vpre, false, view.tree.symbol) - } + val applicableViews: List[SearchResult] = + new ImplicitSearch(tree, functionType(List(ownerTpe), AnyClass.tpe), isView = true, context.makeImplicit(reportAmbiguousErrors = false)) + .allImplicits + for (view <- applicableViews) { + val vtree = viewApply(view) + val vpre = stabilizedType(vtree) + for (sym <- vtree.tpe.members) { + addTypeMember(sym, vpre, false, view.tree.symbol) } + } Stream(members.values.toList) } } @@ -590,6 +594,7 @@ self => applyPhase(namerPhase, unit) } + /** Return fully attributed tree at given position * (i.e. largest tree that's contained by position) */ |