chore(vscode): update to 1.54.2

This commit is contained in:
Joe Previte
2021-03-11 10:27:10 -07:00
1459 changed files with 53404 additions and 51004 deletions

View File

@@ -3,6 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IAction } from 'vs/base/common/actions';
export interface ErrorListenerCallback {
(error: any): void;
}
@@ -221,3 +223,31 @@ export class NotSupportedError extends Error {
}
}
}
export class ExpectedError extends Error {
readonly isExpected = true;
}
export interface IErrorOptions {
actions?: ReadonlyArray<IAction>;
}
export interface IErrorWithActions {
actions?: ReadonlyArray<IAction>;
}
export function isErrorWithActions(obj: unknown): obj is IErrorWithActions {
const candidate = obj as IErrorWithActions | undefined;
return candidate instanceof Error && Array.isArray(candidate.actions);
}
export function createErrorWithActions(message: string, options: IErrorOptions = Object.create(null)): Error & IErrorWithActions {
const result = new Error(message);
if (options.actions) {
(result as IErrorWithActions).actions = options.actions;
}
return result;
}