From 6c5916cafe13f1a258f458e8d4ed7ac014e4a7e4 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 15 Dec 2020 14:50:53 +0100 Subject: [PATCH] web api - document some methods I forgot --- src/vs/workbench/workbench.web.api.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/workbench.web.api.ts b/src/vs/workbench/workbench.web.api.ts index f17c4c61b2e..8a7d6bb4c09 100644 --- a/src/vs/workbench/workbench.web.api.ts +++ b/src/vs/workbench/workbench.web.api.ts @@ -456,8 +456,13 @@ interface IPerformanceMark { interface IWorkbench { commands: { + + /** + * Allows to execute a command, either built-in or from extensions. + */ executeCommand(command: string, ...args: any[]): Promise; }, + env: { /** * Retrieve performance marks that have been collected during startup. This function @@ -472,6 +477,15 @@ interface IWorkbench { */ retrievePerformanceMarks(): Promise<[string, readonly IPerformanceMark[]][]>; } + + /** + * Triggers shutdown of the workbench programmatically. After this method is + * called, the workbench is not usable anymore and the page needs to reload + * or closed. + * + * This will also remove any `beforeUnload` handlers that would bring up a + * confirmation dialog. + */ shutdown: () => void; } @@ -626,7 +640,10 @@ export { IDefaultEditor, IDefaultLayout, IDefaultPanelLayout, - IDefaultSideBarLayout + IDefaultSideBarLayout, + + // Env + IPerformanceMark }; //#endregion