refactor: use named argument

This commit is contained in:
Jacob Kim 2025-07-30 15:03:15 -07:00
parent 88d9b6f190
commit 5ffcaaa2e2
3 changed files with 11 additions and 6 deletions

View file

@ -603,7 +603,7 @@ export class Core {
const outcome = await this.nextEditProvider.provideInlineCompletionItems(
msg.data,
undefined,
false,
{ withChain: false },
);
return outcome ? [outcome.completion, outcome.originalEditableRange] : [];
});

View file

@ -247,7 +247,9 @@ export class NextEditProvider {
public async provideInlineCompletionItems(
input: AutocompleteInput,
token: AbortSignal | undefined,
withChain: boolean,
opts?: {
withChain: boolean;
},
): Promise<NextEditOutcome | undefined> {
try {
this.previousRequest = input;
@ -268,7 +270,9 @@ export class NextEditProvider {
// Depending on whether this method is called from provideInlineCompletionItemsWithChain,
// shift the next editable regions.
if (withChain) {
// This is handled here because this must run after the debouncer
// to prevent excessive shifts.
if (opts?.withChain) {
this.shiftNextEditableRegionsInTheCurrentChain();
}
@ -534,8 +538,9 @@ export class NextEditProvider {
return undefined;
}
const WITH_CHAIN = true;
return await this.provideInlineCompletionItems(input, token, WITH_CHAIN);
return await this.provideInlineCompletionItems(input, token, {
withChain: true,
});
} catch (e: any) {
this.onError(e);
}

View file

@ -276,7 +276,7 @@ export class ContinueCompletionProvider
outcome = await this.nextEditProvider.provideInlineCompletionItems(
input,
signal,
false,
{ withChain: false },
);
if (!outcome || !outcome.completion) {