From ac22bcaa06af63e79127bb2fab1b49c2f187ebba Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 11 Aug 2021 15:36:34 +0200 Subject: [PATCH] web API :lipstick: --- src/vs/workbench/workbench.web.api.ts | 32 ++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/workbench.web.api.ts b/src/vs/workbench/workbench.web.api.ts index 208df46672e..46789356009 100644 --- a/src/vs/workbench/workbench.web.api.ts +++ b/src/vs/workbench/workbench.web.api.ts @@ -82,7 +82,7 @@ interface ITunnelOptions { protocol?: string; } -export interface TunnelCreationOptions { +interface TunnelCreationOptions { /** * True when the local operating system will require elevation to use the requested local port. @@ -210,10 +210,12 @@ interface IPosition { } interface IRange { + /** * The start position. It is before or equal to end position. */ readonly start: IPosition; + /** * The end position. It is after or equal to start position. */ @@ -230,7 +232,11 @@ interface IDefaultEditor { interface IDefaultLayout { readonly views?: IDefaultView[]; readonly editors?: IDefaultEditor[]; - /** Forces this layout to be applied even if this isn't the first time the workspace has been opened */ + + /** + * Forces this layout to be applied even if this isn't + * the first time the workspace has been opened + */ readonly force?: boolean; } @@ -500,6 +506,7 @@ interface IPerformanceMark { interface IWorkbench { commands: { + /** * @see [executeCommand](#commands.executeCommand) */ @@ -507,12 +514,21 @@ interface IWorkbench { } env: { + + /** + * @see [getUriScheme](#env.getUriScheme) + */ readonly uriScheme: string; + /** * @see [retrievePerformanceMarks](#commands.retrievePerformanceMarks) */ retrievePerformanceMarks(): Promise<[string, readonly IPerformanceMark[]][]>; - openUri(uri: URI): Promise; + + /** + * @see [openUri](#env.openUri) + */ + openUri(target: URI): Promise; } /** @@ -613,13 +629,23 @@ namespace env { return workbench.env.retrievePerformanceMarks(); } + /** + * @returns the scheme to use for opening the associated desktop + * experience via protocol handler. + */ export async function getUriScheme(): Promise { const workbench = await workbenchPromise; + return workbench.env.uriScheme; } + /** + * Allows to open a `URI` with the standard opener service of the + * workbench. + */ export async function openUri(target: URI): Promise { const workbench = await workbenchPromise; + return workbench.env.openUri(target); } }