Skip to content

Commit

Permalink
vscode: on ext-host race selection ranges, workspace symbols, and doc…
Browse files Browse the repository at this point in the history
…ument symbols against cancellation, microsoft/vscode#140557

Commit: 56a830bc6825a30c03448cbb2bf616abb252a200
  • Loading branch information
Johannes Rieken authored and sourcegraph-bot committed Jan 18, 2022
1 parent b07be2d commit 5ce0693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions vscode/src/vs/workbench/api/common/extHostLanguageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF
}

$provideDocumentSymbols(handle: number, resource: UriComponents, token: CancellationToken): Promise<modes.DocumentSymbol[] | undefined> {
return this._withAdapter(handle, DocumentSymbolAdapter, adapter => adapter.provideDocumentSymbols(URI.revive(resource), token), undefined);
return this._withAdapter(handle, DocumentSymbolAdapter, adapter => adapter.provideDocumentSymbols(URI.revive(resource), token), undefined, token);
}

// --- code lens
Expand Down Expand Up @@ -1953,7 +1953,7 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF
}

$provideWorkspaceSymbols(handle: number, search: string, token: CancellationToken): Promise<extHostProtocol.IWorkspaceSymbolsDto> {
return this._withAdapter(handle, NavigateTypeAdapter, adapter => adapter.provideWorkspaceSymbols(search, token), { symbols: [] });
return this._withAdapter(handle, NavigateTypeAdapter, adapter => adapter.provideWorkspaceSymbols(search, token), { symbols: [] }, token);
}

$resolveWorkspaceSymbol(handle: number, symbol: extHostProtocol.IWorkspaceSymbolDto, token: CancellationToken): Promise<extHostProtocol.IWorkspaceSymbolDto | undefined> {
Expand Down Expand Up @@ -2170,7 +2170,7 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF
}

$provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise<modes.SelectionRange[][]> {
return this._withAdapter(handle, SelectionRangeAdapter, adapter => adapter.provideSelectionRanges(URI.revive(resource), positions, token), []);
return this._withAdapter(handle, SelectionRangeAdapter, adapter => adapter.provideSelectionRanges(URI.revive(resource), positions, token), [], token);
}

// --- call hierarchy
Expand Down
4 changes: 2 additions & 2 deletions vscode/src/vs/workbench/contrib/search/common/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { onUnexpectedError } from 'vs/base/common/errors';
import { onUnexpectedExternalError } from 'vs/base/common/errors';
import { IDisposable } from 'vs/base/common/lifecycle';
import { ISearchConfiguration, ISearchConfigurationProperties } from 'vs/workbench/services/search/common/search';
import { SymbolKind, Location, ProviderResult, SymbolTag } from 'vs/editor/common/languages';
Expand Down Expand Up @@ -79,7 +79,7 @@ export async function getWorkspaceSymbols(query: string, token: CancellationToke
all.push(new WorkspaceSymbolItem(symbol, provider));
}
} catch (err) {
onUnexpectedError(err);
onUnexpectedExternalError(err);
}
});

Expand Down

0 comments on commit 5ce0693

Please sign in to comment.