提交 b8b59806 编写于 作者: J Joao Moreno

suggest: fix sorting

上级 7bc046f6
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册