From 51fe691d22a92d46288a436fac5ae4a09502133c Mon Sep 17 00:00:00 2001 From: HaoboGu Date: Tue, 19 May 2020 10:26:39 +0800 Subject: [PATCH] fix #98102 When VSCode selects preselected completion items, the index shouldn't start from 1. If there are multiple completion items with preselect=true, the first item will never be chosen. --- src/vs/editor/contrib/suggest/suggestMemory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/suggest/suggestMemory.ts b/src/vs/editor/contrib/suggest/suggestMemory.ts index 9fff61fe466..a33e6e3191f 100644 --- a/src/vs/editor/contrib/suggest/suggestMemory.ts +++ b/src/vs/editor/contrib/suggest/suggestMemory.ts @@ -26,7 +26,7 @@ export abstract class Memory { return 0; } let topScore = items[0].score[0]; - for (let i = 1; i < items.length; i++) { + for (let i = 0; i < items.length; i++) { const { score, completion: suggestion } = items[i]; if (score[0] !== topScore) { // stop when leaving the group of top matches -- GitLab