From c1e4279cf85aff0b4fdfccbe605fc391aa599e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Thu, 24 Oct 2024 16:14:03 +0200 Subject: [PATCH] Accept a string argument in env.openExternal API (#14350) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #14335 contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder --- packages/plugin-ext/src/plugin/window-state.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin-ext/src/plugin/window-state.ts b/packages/plugin-ext/src/plugin/window-state.ts index ed6d4b9cbe208..9492973d6250e 100644 --- a/packages/plugin-ext/src/plugin/window-state.ts +++ b/packages/plugin-ext/src/plugin/window-state.ts @@ -55,7 +55,13 @@ export class WindowStateExtImpl implements WindowStateExt { this.windowStateChangedEmitter.fire(this.windowStateCached); } - openUri(uri: URI): Promise { + async openUri(uriOrString: URI | string): Promise { + let uri: URI; + if (typeof uriOrString === 'string') { + uri = URI.parse(uriOrString); + } else { + uri = uriOrString; + } if (!uri.scheme.trim().length) { throw new Error('Invalid scheme - cannot be empty'); }