Skip to content

Commit c479686

Browse files
committed
Fix completion in a different way
1 parent 20f1eff commit c479686

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,15 +3149,15 @@ object Parsers {
31493149
mkTree(qual, ImportSelector(wildcardSelectorId()) :: Nil)
31503150
case LBRACE =>
31513151
mkTree(qual, inBraces(importSelectors(idOK = true)))
3152-
case IDENTIFIER | BACKQUOTED_IDENT =>
3152+
case _ =>
31533153
val start = in.offset
31543154
val name = ident()
31553155
if in.token == DOT then
31563156
importSelection(atSpan(startOffset(qual), start) { Select(qual, name) })
31573157
else
3158-
mkTree(qual, ImportSelector(atSpan(start) { Ident(name) }) :: Nil)
3159-
case _ =>
3160-
idSelector(qual) // this will produce an error, which can lead to a completion in the repl
3158+
atSpan(startOffset(qual)) {
3159+
mkTree(qual, ImportSelector(atSpan(start) { Ident(name) }) :: Nil)
3160+
}
31613161

31623162
() => importSelection(simpleRef())
31633163
}

0 commit comments

Comments
 (0)