Skip to content

Commit

Permalink
fix(autoedit): fix suffix matching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
valerybugakov committed Nov 21, 2024
1 parent 3c353d9 commit 325e5cc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions vscode/src/autoedits/autoedits-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 325e5cc

Please sign in to comment.