fix: terminal suggestions to sort by fuzzy score

Signed-off-by: Chapman Pendery <cpendery@microsoft.com>
This commit is contained in:
Chapman Pendery 2024-03-22 23:08:19 -07:00
parent cf216ecd5a
commit 42a6be0479

View file

@ -40,7 +40,7 @@ export class SimpleCompletionModel {
private readonly _items: SimpleCompletionItem[],
private _lineContext: LineContext,
readonly replacementIndex: number,
readonly replacementLength: number
readonly replacementLength: number,
) {
}
@ -182,7 +182,7 @@ export class SimpleCompletionModel {
labelLengths.push(item.completion.label.length);
}
this._filteredItems = target; // target.sort(this._snippetCompareFn);
this._filteredItems = target.sort((a, b) => b.score[0] - a.score[0]);
this._refilterKind = Refilter.Nothing;
this._stats = {