Skip to content

Commit 0202822

Browse files
authored
Merge pull request #3369 from rsoeldner/fix-repl-suffix-$
Fix #3337 - Repl CompanionObject
2 parents 26aba2b + 7c1434c commit 0202822

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object Interactive {
115115
/** Filter for names that should appear when looking for completions. */
116116
private[this] object completionsFilter extends NameFilter {
117117
def apply(pre: Type, name: Name)(implicit ctx: Context): Boolean =
118-
!name.isConstructorName && name.is(SimpleNameKind)
118+
!name.isConstructorName && name.toTermName.info.kind == SimpleNameKind
119119
}
120120

121121
/** Find named trees with a non-empty position whose symbol match `sym` in `trees`.

compiler/test/dotty/tools/repl/TabcompleteTests.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class TabcompleteTests extends ReplTest {
2929
comp.suggestions.sorted == List("slice", "sliding"))
3030
}
3131

32+
@Test def tabCompleteModule: Unit =
33+
fromInitialState{ implicit s =>
34+
val comp = tabComplete("scala.Pred")
35+
assertEquals(comp.suggestions,List("Predef"))
36+
}
37+
3238
@Test def autoCompleteValAssign: Unit =
3339
fromInitialState { implicit s => tabComplete("val x = 5") }
3440

0 commit comments

Comments
 (0)