File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
compiler/src/dotty/tools/dotc/interactive
presentation-compiler/test/dotty/tools/pc/tests/completion Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ object Completion:
8888 * Otherwise, provide no completion suggestion.
8989 */
9090 def completionMode (path : List [untpd.Tree ], pos : SourcePosition ): Mode = path match
91+ // Ignore `package foo@@` and `package foo.bar@@`
92+ case ((_ : tpd.Select ) | (_ : tpd.Ident )):: (_ : tpd.PackageDef ) :: _ => Mode .None
9193 case GenericImportSelector (sel) =>
9294 if sel.imported.span.contains(pos.span) then Mode .ImportOrExport // import scala.@@
9395 else if sel.isGiven && sel.bound.span.contains(pos.span) then Mode .ImportOrExport
Original file line number Diff line number Diff line change @@ -2189,3 +2189,17 @@ class CompletionSuite extends BaseCompletionSuite:
21892189 |""" .stripMargin,
21902190 topLines = Some (3 )
21912191 )
2192+
2193+ @ Test def `packageIssueIdent` =
2194+ check(
2195+ """ package one@@
2196+ |""" .stripMargin,
2197+ " "
2198+ )
2199+
2200+ @ Test def `packageIssueSelect` =
2201+ check(
2202+ """ package one.two@@
2203+ |""" .stripMargin,
2204+ " "
2205+ )
You can’t perform that action at this time.
0 commit comments