Skip to content

Commit c639cd4

Browse files
committed
Sort completions by 'Name'
1 parent d1dc25b commit c639cd4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ object Interactive {
218218
case (sel @ Select(qual, _)) :: _ => getMemberCompletions(qual)
219219
case _ => getScopeCompletions(ctx)
220220
}
221-
interactiv.println(i"completion with pos = $pos, prefix = $prefix, termOnly = $termOnly, typeOnly = $typeOnly = ${completions.toList}%, %")
222-
(completionPos, completions.toList.sortBy(_.name.toString))
221+
222+
val sortedCompletions = completions.toList.sortBy(_.name: Name)
223+
interactiv.println(i"completion with pos = $pos, prefix = $prefix, termOnly = $termOnly, typeOnly = $typeOnly = $sortedCompletions%, %")
224+
(completionPos, sortedCompletions)
223225
}
224226

225227
/** Possible completions of members of `prefix` which are accessible when called inside `boundary` */

0 commit comments

Comments
 (0)