fix: model should now recompute outcome at each next edit location

This commit is contained in:
Jacob Kim 2025-07-30 17:28:29 -07:00
parent 09cbcdba55
commit 2cbfe9748f

View file

@ -432,10 +432,29 @@ export class ContinueCompletionProvider
0 &&
!jumpSuccessful
) {
// NOTE: Outcome has to be re-computed for each next editable location.
const nextRegion =
this.nextEditProvider.shiftNextEditableRegionsInTheCurrentChain();
this.nextEditProvider.getNextEditableRegionsInTheCurrentChain()[0];
if (!nextRegion) continue;
// Getting the outcome shifts the next editable region queue,
// deleting the item denoted by nextRegion above.
outcome =
await this.nextEditProvider.provideInlineCompletionItemsWithChain(
{
completionId,
manuallyPassFileContents,
manuallyPassPrefix,
selectedCompletionInfo,
isUntitledFile: document.isUntitled,
recentlyVisitedRanges,
recentlyEditedRanges,
},
signal,
);
if (!outcome) continue;
const jumpPosition = new vscode.Position(
nextRegion.range.start.line,
nextRegion.range.start.character,