Skip to content

Commit f6228da

Browse files
committed
Fix #5237: Do not list <xyz> in scala packege completions
1 parent 845fd59 commit f6228da

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ object Completion {
140140
private[this] val completions = new RenameAwareScope
141141

142142
/**
143-
* Return the list of symbols that shoudl be included in completion results.
143+
* Return the list of symbols that should be included in completion results.
144144
*
145145
* If several symbols share the same name, the type symbols appear before term symbols inside
146146
* the same `Completion`.
@@ -252,7 +252,10 @@ object Completion {
252252
(
253253
(mode.is(Mode.Term) && sym.isTerm)
254254
|| (mode.is(Mode.Type) && (sym.isType || sym.isStable))
255-
)
255+
) &&
256+
(sym ne defn.RepeatedParamClass) &&
257+
(sym ne defn.ByNameParamClass2x) &&
258+
(sym ne defn.EqualsPatternClass)
256259

257260
/**
258261
* Find all the members of `site` that are accessible and which should be included in `info`.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,10 @@ class TabcompleteTests extends ReplTest {
9090
val expected = List("Renamed")
9191
assertEquals(expected, tabComplete("val foo: Rena"))
9292
}
93+
94+
@Test def importScala = fromInitialState { implicit s =>
95+
val comp = tabComplete("import scala.")
96+
// check that there are no special symbols leaked: <byname>, <special-ops>, ...
97+
assertEquals(comp.find(_.startsWith("<")), None)
98+
}
9399
}

0 commit comments

Comments
 (0)