Skip to content

Commit

Permalink
finalize CancellationError API, fixes #93686
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Jan 13, 2021
1 parent adb037b commit 152d0ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
15 changes: 15 additions & 0 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,21 @@ declare module 'vscode' {
dispose(): void;
}

/**
* An error type that should be used to signal cancellation of an operation.
*
* This type can be used in response to a [cancellation token](#CancellationToken)
* being cancelled or when an operation is being cancelled by the
* executor of that operation.
*/
export class CancellationError extends Error {

/**
* Creates a new cancellation error.
*/
constructor();
}

/**
* Represents a type which can release resources, such
* as event listening or a timer.
Expand Down
19 changes: 0 additions & 19 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@

declare module 'vscode' {

//#region https://github.com/microsoft/vscode/issues/93686

/**
* An error type should be used to signal cancellation of an operation.
*
* This type can be used in response to a cancellation token or when an
* operation is being cancelled by the executor of that operation.
*/
export class CancellationError extends Error {

/**
* Creates a new cancellation error.
*/
constructor();
}


//#endregion

// #region auth provider: https://github.com/microsoft/vscode/issues/88309

/**
Expand Down
4 changes: 1 addition & 3 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
CallHierarchyIncomingCall: extHostTypes.CallHierarchyIncomingCall,
CallHierarchyItem: extHostTypes.CallHierarchyItem,
CallHierarchyOutgoingCall: extHostTypes.CallHierarchyOutgoingCall,
CancellationError: errors.CancellationError,
CancellationTokenSource: CancellationTokenSource,
CodeAction: extHostTypes.CodeAction,
CodeActionKind: extHostTypes.CodeActionKind,
Expand Down Expand Up @@ -1190,9 +1191,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
ViewColumn: extHostTypes.ViewColumn,
WorkspaceEdit: extHostTypes.WorkspaceEdit,
// proposed api types
get CancellationError() {
return errors.CancellationError;
},
get RemoteAuthorityResolverError() {
// checkProposedApiEnabled(extension);
return extHostTypes.RemoteAuthorityResolverError;
Expand Down

0 comments on commit 152d0ec

Please sign in to comment.