Revert "allow $openUri to accept a URI and string, adopt consumer but keep the API as is"

This reverts commit 544b0abf5b.
This commit is contained in:
Johannes Rieken
2019-11-15 10:29:29 +01:00
parent 544b0abf5b
commit e51ef85bcb
4 changed files with 21 additions and 29 deletions

View File

@@ -39,6 +39,18 @@ 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);
}