debt - remove TPromise from ExtHostUrls
This commit is contained in:
parent
66ba38c55d
commit
3a444bfeb1
3 changed files with 9 additions and 6 deletions
|
@ -24,7 +24,7 @@ class ExtensionUrlHandler implements IURLHandler {
|
|||
return TPromise.as(false);
|
||||
}
|
||||
|
||||
return this.proxy.$handleExternalUri(this.handle, uri).then(() => true);
|
||||
return TPromise.wrap(this.proxy.$handleExternalUri(this.handle, uri)).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -466,7 +466,7 @@ export interface MainThreadUrlsShape extends IDisposable {
|
|||
}
|
||||
|
||||
export interface ExtHostUrlsShape {
|
||||
$handleExternalUri(handle: number, uri: UriComponents): TPromise<void>;
|
||||
$handleExternalUri(handle: number, uri: UriComponents): Thenable<void>;
|
||||
}
|
||||
|
||||
export interface MainThreadWorkspaceShape extends IDisposable {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { MainContext, IMainContext, ExtHostUrlsShape, MainThreadUrlsShape } from
|
|||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { asWinJsPromise } from 'vs/base/common/async';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
export class ExtHostUrls implements ExtHostUrlsShape {
|
||||
|
||||
|
@ -41,14 +41,17 @@ export class ExtHostUrls implements ExtHostUrlsShape {
|
|||
});
|
||||
}
|
||||
|
||||
$handleExternalUri(handle: number, uri: UriComponents): TPromise<void> {
|
||||
$handleExternalUri(handle: number, uri: UriComponents): Thenable<void> {
|
||||
const handler = this.handlers.get(handle);
|
||||
|
||||
if (!handler) {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
asWinJsPromise(_ => handler.handleUri(URI.revive(uri)));
|
||||
try {
|
||||
handler.handleUri(URI.revive(uri));
|
||||
} catch (err) {
|
||||
onUnexpectedError(err);
|
||||
}
|
||||
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue