Skip to content

Commit f3092a3

Browse files
committed
small refactor
1 parent 61d59a1 commit f3092a3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/src/dotty/tools/dotc/interactive/Completion.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,11 @@ object Completion:
154154

155155
val completer = new Completer(mode, prefix, pos)
156156

157-
val completions = path0 match
158-
case untpd.Select(qual, _) :: _ :: untpd.ExtMethods(_, _) :: _ =>
159-
val tpdQual = ctx.typer.typedExpr(qual)
160-
completer.selectionCompletions(tpdQual)
161-
case _ => tpdPath match
157+
val adjustedPath: List[Tree] = path0 match
158+
case (sel: untpd.Select) :: _ :: untpd.ExtMethods(_, _) :: _ => List(ctx.typer.typedExpr(sel))
159+
case _ => tpdPath
162160

161+
val completions = adjustedPath match
163162
// Ignore synthetic select from `This` because in code it was `Ident`
164163
// See example in dotty.tools.languageserver.CompletionTest.syntheticThis
165164
case Select(qual @ This(_), _) :: _ if qual.span.isSynthetic => completer.scopeCompletions

0 commit comments

Comments
 (0)