@@ -197,18 +197,18 @@ object Completion {
197
197
while ctx ne NoContext do
198
198
if ctx.isImportContext then
199
199
importedCompletions(using ctx).foreach { (name, denots) =>
200
- addMapping(name, ScopedDenotations (denots, ctx.scope, isFromImport = true ))
200
+ addMapping(name, ScopedDenotations (denots, ctx))
201
201
}
202
202
else if ctx.owner.isClass then
203
203
accessibleMembers(ctx.owner.thisType)
204
204
.groupByName.foreach { (name, denots) =>
205
- addMapping(name, ScopedDenotations (denots, ctx.scope, isFromImport = false ))
205
+ addMapping(name, ScopedDenotations (denots, ctx))
206
206
}
207
207
else if ctx.scope != null then
208
208
ctx.scope.toList.filter(symbol => include(symbol, symbol.name))
209
209
.flatMap(_.alternatives)
210
210
.groupByName.foreach { (name, denots) =>
211
- addMapping(name, ScopedDenotations (denots, ctx.scope, isFromImport = false ))
211
+ addMapping(name, ScopedDenotations (denots, ctx))
212
212
}
213
213
214
214
ctx = ctx.outer
@@ -218,13 +218,13 @@ object Completion {
218
218
219
219
mappings.foreach { (name, denotss) =>
220
220
val first = denotss.head
221
- denotss.find(! _.isFromImport ) match {
221
+ denotss.find(! _.ctx.isImportContext ) match {
222
222
// most deeply nested member or local definition if not shadowed by an import
223
- case Some (ScopedDenotations (denots, scope, _)) if scope == first.scope =>
224
- resultMappings += name -> denots
223
+ case Some (local) if local.ctx. scope == first.ctx .scope =>
224
+ resultMappings += name -> local. denots
225
225
226
226
// most deeply nested import if not shadowed by another import
227
- case None if denotss.length < 2 || (denotss(1 ).scope ne first.scope) =>
227
+ case None if denotss.length < 2 || (denotss(1 ).ctx. scope ne first.ctx .scope) =>
228
228
resultMappings += name -> first.denots
229
229
230
230
case _ =>
@@ -436,11 +436,7 @@ object Completion {
436
436
/** Temporary data structure representing denotations with the same name introduced in a given scope
437
437
* as a member of a type, by a local definition or by an import clause
438
438
*/
439
- private case class ScopedDenotations (
440
- denots : Seq [SingleDenotation ],
441
- scope : Scope ,
442
- isFromImport : Boolean
443
- )
439
+ private case class ScopedDenotations (denots : Seq [SingleDenotation ], ctx : Context )
444
440
445
441
/**
446
442
* The completion mode: defines what kinds of symbols should be included in the completion
0 commit comments