@@ -149,11 +149,7 @@ object Completion {
149
149
val groupedSymbols = {
150
150
val symbols = completions.toListWithNames
151
151
val nameToSymbols = symbols.groupBy(_._2.stripModuleClassSuffix.toSimpleName)
152
- nameToSymbols.mapValues { symbols =>
153
- symbols
154
- .map(_._1)
155
- .distinct // Show symbols that have been renamed multiple times only once
156
- }.toList
152
+ nameToSymbols.mapValues(_.map(_._1)).toList
157
153
}
158
154
groupedSymbols.map { case (name, symbols) =>
159
155
val typesFirst = symbols.sortWith((s1, s2) => s1.isType && ! s2.isType)
@@ -352,20 +348,20 @@ object Completion {
352
348
* in the REPL and the IDE.
353
349
*/
354
350
private class RenameAwareScope extends Scopes .MutableScope {
355
- private [this ] val renames : mutable.Map [Symbol , List [Name ]] = mutable.Map .empty
351
+ private [this ] val nameToSymbols : mutable.Map [Name , List [Symbol ]] = mutable.Map .empty
356
352
357
353
/** Enter the symbol `sym` in this scope, recording a potential renaming. */
358
354
def enter [T <: Symbol ](sym : T , name : Name )(implicit ctx : Context ): T = {
359
- renames += sym -> (name :: renames .getOrElse(sym , Nil ))
355
+ nameToSymbols += name -> (sym :: nameToSymbols .getOrElse(name , Nil ))
360
356
newScopeEntry(name, sym)
361
357
sym
362
358
}
363
359
364
360
/** Lists the symbols in this scope along with the name associated with them. */
365
361
def toListWithNames (implicit ctx : Context ): List [(Symbol , Name )] = {
366
362
for {
367
- sym <- toList
368
- name <- renames.getOrElse(sym, List (sym.name))
363
+ (name, syms) <- nameToSymbols. toList
364
+ sym <- syms
369
365
} yield (sym, name)
370
366
}
371
367
}
0 commit comments