Skip to content

Commit

Permalink
Try to sort console history entries in recency order (#165549)
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens authored Nov 4, 2022
1 parent c91649f commit 4001e9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vs/workbench/contrib/debug/browser/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,13 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {

if (this.configurationService.getValue<IDebugConfiguration>('debug').console.historySuggestions) {
const history = this.history.getHistory();
history.forEach(h => suggestions.push({
const idxLength = String(history.length).length;
history.forEach((h, i) => suggestions.push({
label: h,
insertText: h,
kind: CompletionItemKind.Text,
range: computeRange(h.length),
sortText: 'ZZZ'
sortText: 'ZZZ' + String(history.length - i).padStart(idxLength, '0')
}));
}

Expand Down

0 comments on commit 4001e9d

Please sign in to comment.