@@ -9,6 +9,7 @@ import ast.{NavigateAST, Trees, tpd, untpd}
99import core ._ , core .Decorators .{sourcePos => _ , _ }
1010import Contexts ._ , Flags ._ , Names ._ , NameOps ._ , Symbols ._ , SymDenotations ._ , Trees ._ , Types ._
1111import util .Positions ._ , util .SourcePosition
12+ import core .Denotations .SingleDenotation
1213import NameKinds .SimpleNameKind
1314
1415/** High-level API to get information out of typed trees, designed to be used by IDEs.
@@ -126,13 +127,11 @@ object Interactive {
126127 safely {
127128 if (boundary != NoSymbol ) {
128129 val boundaryCtx = ctx.withOwner(boundary)
129- prefix.memberDenots(completionsFilter, (name, buf) =>
130- buf ++= prefix.member(name).altsWith{ d =>
131- ! d.isAbsent &&
132- ! d.is(Synthetic ) && ! d.is(Artifact ) &&
133- d.symbol.isAccessibleFrom(prefix)(boundaryCtx)
134- }
135- ).map(_.symbol).toList
130+ def exclude (sym : Symbol ) = sym.isAbsent || sym.is(Synthetic ) || sym.is(Artifact )
131+ def addMember (name : Name , buf : mutable.Buffer [SingleDenotation ]): Unit =
132+ buf ++= prefix.member(name).altsWith(d =>
133+ ! exclude(d) && d.symbol.isAccessibleFrom(prefix)(boundaryCtx))
134+ prefix.memberDenots(completionsFilter, addMember).map(_.symbol).toList
136135 }
137136 else Nil
138137 }
0 commit comments