@@ -370,7 +370,7 @@ object Completion:
370370 * For the results of all `xyzCompletions` methods term names and type names are always treated as different keys in the same map
371371 * and they never conflict with each other.
372372 */
373- class Completer (val mode : Mode , pos : SourcePosition , untpdPath : List [untpd.Tree ], matches : Name => Boolean ):
373+ class Completer (val mode : Mode , pos : SourcePosition , untpdPath : List [untpd.Tree ], matches : Name => Boolean )( using Context ) :
374374 /** Completions for terms and types that are currently in scope:
375375 * the members of the current class, local definitions and the symbols that have been imported,
376376 * recursively adding completions from outer scopes.
@@ -384,7 +384,7 @@ object Completion:
384384 * (even if the import follows it syntactically)
385385 * - a more deeply nested import shadowing a member or a local definition causes an ambiguity
386386 */
387- def scopeCompletions ( using context : Context ) : CompletionResult =
387+ lazy val scopeCompletions : CompletionResult =
388388
389389 /** Temporary data structure representing denotations with the same name introduced in a given scope
390390 * as a member of a type, by a local definition or by an import clause
@@ -619,8 +619,7 @@ object Completion:
619619 // There are four possible ways for an extension method to be applicable
620620
621621 // 1. The extension method is visible under a simple name, by being defined or inherited or imported in a scope enclosing the reference.
622- val termCompleter = new Completer (Mode .Term , pos, untpdPath, matches)
623- val extMethodsInScope = termCompleter.scopeCompletions.names.toList.flatMap:
622+ val extMethodsInScope = scopeCompletions.names.toList.flatMap:
624623 case (name, denots) => denots.collect:
625624 case d : SymDenotation if d.isTerm && d.termRef.symbol.is(Extension ) => (d.termRef, name.asTermName)
626625
0 commit comments