Skip to content

Commit 1f6f0fc

Browse files
committed
Don't cancel an all-provider request when the single-provider request is a subset
1 parent 6605cd3 commit 1f6f0fc

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class InlineCompletionsModel extends Disposable {
427427
const suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get();
428428
const availableProviders = providers.providers.filter(provider => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId)));
429429

430-
return this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, !!changeSummary.provider, requestInfo);
430+
return this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo);
431431
});
432432

433433
public async trigger(tx?: ITransaction, options?: { onlyFetchInlineEdits?: boolean; noDelay?: boolean }): Promise<void> {

src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,14 @@ export class InlineCompletionsSource extends Disposable {
117117
activeInlineCompletion: InlineSuggestionIdentity | undefined,
118118
withDebounce: boolean,
119119
userJumpedToActiveCompletion: IObservable<boolean>,
120-
providerhasChangedCompletion: boolean,
121120
requestInfo: InlineSuggestRequestInfo
122121
): Promise<boolean> {
123122
const position = this._cursorPosition.get();
124123
const request = new UpdateRequest(position, context, this._textModel.getVersionId(), new Set(providers));
125124

126125
const target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();
127126

128-
if (!providerhasChangedCompletion && this._updateOperation.value?.request.satisfies(request)) {
127+
if (this._updateOperation.value?.request.satisfies(request)) {
129128
return this._updateOperation.value.promise;
130129
} else if (target?.request?.satisfies(request)) {
131130
return Promise.resolve(true);

src/vs/editor/contrib/inlineCompletions/browser/structuredLogger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ interface IFetchResult {
5353
* The sourceLabel must not contain '@'!
5454
*/
5555
export function formatRecordableLogEntry<T extends IRecordableLogEntry>(entry: T): string {
56-
return entry.sourceId + ' @@ ' + JSON.stringify({ ...entry, sourceId: undefined });
56+
return entry.sourceId + ' @@ ' + JSON.stringify({ ...entry, modelUri: (entry as any).modelUri?.toString(), sourceId: undefined });
5757
}
5858

5959
export class StructuredLogger<T extends IRecordableLogEntry> extends Disposable {

0 commit comments

Comments
 (0)