From 325e5cc6a5c72620376ff342f98543a1324e253d Mon Sep 17 00:00:00 2001 From: Valery Bugakov Date: Thu, 21 Nov 2024 20:09:04 +0800 Subject: [PATCH] fix(autoedit): fix suffix matching logic --- vscode/src/autoedits/autoedits-provider.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vscode/src/autoedits/autoedits-provider.ts b/vscode/src/autoedits/autoedits-provider.ts index 6d97e363fa3a..74fa17f6bd1f 100644 --- a/vscode/src/autoedits/autoedits-provider.ts +++ b/vscode/src/autoedits/autoedits-provider.ts @@ -212,10 +212,7 @@ export class AutoeditsProvider implements vscode.InlineCompletionItemProvider, v const isPrefixMatch = prediction.startsWith(codeToReplace.codeToRewritePrefix) const isSuffixMatch = // The current line suffix should not require any char removals to render the completion. - completionMatchesSuffix( - { insertText: codeToReplace.codeToRewriteSuffix }, - docContext.currentLineSuffix - ) && + completionMatchesSuffix({ insertText: prediction }, docContext.currentLineSuffix) && // The new lines suggested after the current line must be equal to the prediction. prediction.endsWith(codeToRewriteAfterCurrentLine)