提交 e24a82b3 编写于 作者: S Sandeep Somavarapu

ExtensionWorkbenchService.open return promise

上级 afbba481
......@@ -70,7 +70,7 @@ export interface IExtensionsWorkbenchService {
install(extension: IExtension, promptToInstallDependencies?: boolean): TPromise<void>;
uninstall(extension: IExtension): TPromise<void>;
loadDependencies(extension: IExtension): TPromise<IExtensionDependencies>;
open(extension: IExtension, sideByside?: boolean): void;
open(extension: IExtension, sideByside?: boolean): TPromise<any>;
}
export const ConfigurationKey = 'extensions';
......
......@@ -116,7 +116,7 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet {
chain(this.list.onSelectionChange)
.map(e => e.elements[0])
.filter(e => !!e)
.on(this.extensionsWorkbenchService.open, this, this.disposables);
.on(this.openExtension, this, this.disposables);
return TPromise.as(null);
}
......@@ -296,6 +296,10 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet {
.then(result => new PagedModel(result));
}
private openExtension(extension: IExtension): void {
this.extensionsWorkbenchService.open(extension).done(null, err => this.onError(err));
}
private onEnter(): void {
this.list.setSelection(...this.list.getFocus());
}
......
......@@ -368,9 +368,8 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
});
}
open(extension: IExtension, sideByside: boolean = false): void {
this.editorService.openEditor(this.instantiationService.createInstance(ExtensionsInput, extension), null, sideByside)
.done(null, err => this.onError(err));
open(extension: IExtension, sideByside: boolean = false): TPromise<any> {
return this.editorService.openEditor(this.instantiationService.createInstance(ExtensionsInput, extension), null, sideByside);
}
private fromGallery(gallery: IGalleryExtension): Extension {
......@@ -625,7 +624,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
}
const extension = result.firstPage[0];
this.open(extension);
this.open(extension).done(null, error => this.onError(error));
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册