File tree 2 files changed +16
-0
lines changed
compiler/src/dotty/tools/dotc/interactive
presentation-compiler/test/dotty/tools/pc/tests/completion
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ object Completion:
88
88
* Otherwise, provide no completion suggestion.
89
89
*/
90
90
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
91
93
case GenericImportSelector (sel) =>
92
94
if sel.imported.span.contains(pos.span) then Mode .ImportOrExport // import scala.@@
93
95
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:
2189
2189
|""" .stripMargin,
2190
2190
topLines = Some (3 )
2191
2191
)
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