allow to race against cancellation when invoking _withAdapter, never log cancellation errors, https://github.com/microsoft/vscode/issues/140557

This commit is contained in:
Johannes Rieken
2022-01-12 16:17:21 +01:00
parent 603274e3d2
commit e5703c8405
2 changed files with 16 additions and 16 deletions
@@ -24,7 +24,7 @@ import * as typeh from 'vs/workbench/contrib/typeHierarchy/common/typeHierarchy'
import { mixin } from 'vs/base/common/objects';
import { decodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto';
import { revive } from 'vs/base/common/marshalling';
import { canceled } from 'vs/base/common/errors';
import { CancellationError } from 'vs/base/common/errors';
@extHostNamedCustomer(MainContext.MainThreadLanguageFeatures)
export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesShape {
@@ -451,7 +451,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
// --- suggest
private static _inflateSuggestDto(defaultRange: IRange | { insert: IRange, replace: IRange }, data: ISuggestDataDto): modes.CompletionItem {
private static _inflateSuggestDto(defaultRange: IRange | { insert: IRange, replace: IRange; }, data: ISuggestDataDto): modes.CompletionItem {
const label = data[ISuggestDataDtoField.label];
@@ -576,7 +576,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
}
const result = await this._proxy.$resolveInlayHint(handle, dto.cacheId, token);
if (token.isCancellationRequested) {
throw canceled();
throw new CancellationError();
}
if (!result) {
return hint;