Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/interactive/Completion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ object Completion:
* Otherwise, provide no completion suggestion.
*/
def completionMode(path: List[untpd.Tree], pos: SourcePosition): Mode = path match
// Ignore `package foo@@` and `package foo.bar@@`
case ((_: tpd.Select) | (_: tpd.Ident)):: (_ : tpd.PackageDef) :: _ => Mode.None
case GenericImportSelector(sel) =>
if sel.imported.span.contains(pos.span) then Mode.ImportOrExport // import scala.@@
else if sel.isGiven && sel.bound.span.contains(pos.span) then Mode.ImportOrExport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2223,3 +2223,17 @@ class CompletionSuite extends BaseCompletionSuite:
|""".stripMargin,
topLines = Some(3)
)

@Test def `packageIssueIdent` =
check(
"""package one@@
|""".stripMargin,
""
)

@Test def `packageIssueSelect` =
check(
"""package one.two@@
|""".stripMargin,
""
)
Loading