Skip to content

Commit 89f850a

Browse files
committed
Always remove duplicates in completion
1 parent a746215 commit 89f850a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,11 @@ object Completion {
135135
* preferred over term symbols.
136136
*/
137137
def getCompletions(implicit ctx: Context): List[Symbol] = {
138-
if (!mode.is(Mode.Import)) completions.toList
139-
else {
140-
// In imports, show only the type symbols when there are multiple options with the same name
141-
completions.toList.groupBy(_.name.stripModuleClassSuffix.toSimpleName).mapValues {
142-
case sym :: Nil => sym :: Nil
143-
case syms => syms.filter(_.isType)
144-
}.values.flatten.toList
145-
}
138+
// Show only the type symbols when there are multiple options with the same name
139+
completions.toList.groupBy(_.name.stripModuleClassSuffix.toSimpleName).mapValues {
140+
case sym :: Nil => sym :: Nil
141+
case syms => syms.filter(_.isType)
142+
}.values.flatten.toList
146143
}
147144

148145
/**

0 commit comments

Comments
 (0)