summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/Global.scala
diff options
context:
space:
mode:
authorEugene Vigdorchik <eugenevigdorchik@epfl.ch>2011-01-18 17:36:53 +0000
committerEugene Vigdorchik <eugenevigdorchik@epfl.ch>2011-01-18 17:36:53 +0000
commitb9f20bf6d5e3611fafba0d0b5835dca81f80b10a (patch)
treeaf013e1de4235876b36fbf62d0f94a4067e385f4 /src/compiler/scala/tools/nsc/interactive/Global.scala
parentfc68a188f2c61eecc7f1b7a1b5294d5ca2512208 (diff)
downloadscala-b9f20bf6d5e3611fafba0d0b5835dca81f80b10a.tar.gz
scala-b9f20bf6d5e3611fafba0d0b5835dca81f80b10a.tar.bz2
scala-b9f20bf6d5e3611fafba0d0b5835dca81f80b10a.zip
Completion related fix and cleanup.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index a563b25f44..7637eaff7e 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -515,6 +515,7 @@ self =>
def addScopeMember(sym: Symbol, pre: Type, viaImport: Tree) =
if (!sym.name.decode.containsName(Dollar) &&
!sym.isSynthetic &&
+ sym.hasRawInfo &&
!locals.contains(sym.name)) {
locals(sym.name) = new ScopeMember(
sym,
@@ -554,13 +555,6 @@ self =>
def typeMembers(pos: Position): Stream[List[TypeMember]] = {
var tree = typedTreeAt(pos)
- // Let's say you have something like val x: List[Int] and ypu want to get completion after List
- // Then the tree found at first is a TypeTree, ????
- tree match {
- case tt : TypeTree if tt.original != null => tree = tt.original // ???
- case _ =>
- }
-
// if tree consists of just x. or x.fo where fo is not yet a full member name
// ignore the selection and look in just x.
tree match {
@@ -571,6 +565,7 @@ self =>
val context = doLocateContext(pos)
if (tree.tpe == null)
+ // TODO: guard with try/catch to deal with ill-typed qualifiers.
tree = analyzer.newTyper(context).typedQualifier(tree)
debugLog("typeMembers at "+tree+" "+tree.tpe)
@@ -592,7 +587,7 @@ self =>
}
}
- /** Create a fucntion application of a given view function to `tree` and typechecked it.
+ /** Create a function application of a given view function to `tree` and typechecked it.
*/
def viewApply(view: SearchResult): Tree = {
assert(view.tree != EmptyTree)