feat: save NextEditOutcome instead of string

This commit is contained in:
Jacob Kim 2025-07-22 13:12:24 -07:00
parent 98e41cdccc
commit b1946329ae

View file

@ -70,7 +70,7 @@ export class NextEditProvider {
private prefetchQueue: NextEditPrefetchQueue;
// private refQueue: RangeInFile[] = [];
private currentEditChainId: string | null = null;
private previousCompletions: string[] = [];
private previousCompletions: NextEditOutcome[] = [];
private constructor(
private readonly configHandler: ConfigHandler,
@ -322,7 +322,7 @@ export class NextEditProvider {
return this.currentEditChainId !== null;
}
public getPreviousCompletion(): string | null {
public getPreviousCompletion(): NextEditOutcome | null {
return this.previousCompletions[0];
}
@ -481,7 +481,7 @@ export class NextEditProvider {
).replace(/\n$/, "")
: "";
this.previousCompletions.push(nextCompletion);
// this.previousCompletions.push(nextCompletion);
const currCursorPos = helper.pos;
const editableRegionStartLine = Math.max(
@ -530,6 +530,8 @@ export class NextEditProvider {
...helper.options,
};
this.previousCompletions.push(outcomeNext);
// When using the JetBrains extension, mark as displayed.
// This helps us not need to make additional network calls just to mark as displayed.
const ideType = (await this.ide.getIdeInfo()).ideType;