mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
allow $openUri to accept a URI and string, adopt consumer but keep the API as is
This commit is contained in:
@@ -39,18 +39,6 @@ export class ExtHostWindow implements ExtHostWindowShape {
|
||||
}
|
||||
|
||||
openUri(stringOrUri: string | URI, options: IOpenUriOptions): Promise<boolean> {
|
||||
if (typeof stringOrUri === 'string') {
|
||||
try {
|
||||
stringOrUri = URI.parse(stringOrUri);
|
||||
} catch (e) {
|
||||
return Promise.reject(`Invalid uri - '${stringOrUri}'`);
|
||||
}
|
||||
}
|
||||
if (isFalsyOrWhitespace(stringOrUri.scheme)) {
|
||||
return Promise.reject('Invalid scheme - cannot be empty');
|
||||
} else if (stringOrUri.scheme === Schemas.command) {
|
||||
return Promise.reject(`Invalid scheme '${stringOrUri.scheme}'`);
|
||||
}
|
||||
return this._proxy.$openUri(stringOrUri, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user