Skip to content

Commit

Permalink
Accept a string argument in env.openExternal API (#14350)
Browse files Browse the repository at this point in the history
Fixes #14335

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder authored Oct 24, 2024
1 parent e8e2e92 commit c1e4279
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/plugin-ext/src/plugin/window-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ export class WindowStateExtImpl implements WindowStateExt {
this.windowStateChangedEmitter.fire(this.windowStateCached);
}

openUri(uri: URI): Promise<boolean> {
async openUri(uriOrString: URI | string): Promise<boolean> {
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');
}
Expand Down

0 comments on commit c1e4279

Please sign in to comment.