mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
debt - remove TPromise from ExtHostUrls
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user