Skip to content

Commit 7236174

Browse files
committed
fix: fix edge-case incorrect sorting of 10 or 100th suggestion
1 parent f8f9de7 commit 7236174

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

typescript/src/completionsAtPosition.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ export const getCompletionsAtPosition = (
202202
})
203203
}
204204

205-
if (c('correctSorting.enable')) prior.entries = prior.entries.map((entry, index) => ({ ...entry, sortText: `${entry.sortText ?? ''}${index}` }))
205+
if (c('correctSorting.enable'))
206+
prior.entries = prior.entries.map((entry, index) => ({ ...entry, sortText: `${entry.sortText ?? ''}${index.toString().padStart(4, '0')}` }))
206207

207208
// console.log('signatureHelp', JSON.stringify(languageService.getSignatureHelpItems(fileName, position, {})))
208209
return {

0 commit comments

Comments
 (0)