diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index d147c4ce1bdeeeb468957f404a8b3fb935c114e1..a9fbe1083a59cbdb536f134d95dc13c6b6015f7d 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -40,10 +40,16 @@ function completionItemCompare(item: CompletionItem, otherItem: CompletionItem): const suggestion = item.suggestion; const otherSuggestion = otherItem.suggestion; - // TODO@jrieken - // if (typeof suggestion.sortText === 'string' && typeof otherSuggestion.sortText === 'string') { - // return suggestion.sortText < otherSuggestion.sortText ? -1 : 1; - // } + if (typeof suggestion.sortText === 'string' && typeof otherSuggestion.sortText === 'string') { + const one = suggestion.sortText.toLowerCase(); + const other = otherSuggestion.sortText.toLowerCase(); + + if (one < other) { + return -1; + } else if (one > other) { + return 1; + } + } return suggestion.label.toLowerCase() < otherSuggestion.label.toLowerCase() ? -1 : 1; }