提交 b60cc80e 编写于 作者: B Benjamin Pasero

always make sure to start ext-host when entering workspace, even in error cases

上级 abbcd7e9
......@@ -139,12 +139,15 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
// Stop the extension host first to give extensions most time to shutdown
this.extensionService.stopExtensionHost();
const startExtensionHost = () => {
this.extensionService.startExtensionHost();
};
return mainSidePromise().then(result => {
let enterWorkspacePromise: TPromise<void> = TPromise.as(void 0);
if (result) {
// Migrate storage and settings
enterWorkspacePromise = this.migrate(result.workspace).then(() => {
// Migrate storage and settings if we are to enter a workspace
if (result) {
return this.migrate(result.workspace).then(() => {
// Reinitialize backup service
const backupFileService = this.backupFileService as BackupFileService; // TODO@Ben ugly cast
......@@ -156,9 +159,8 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
});
}
// Finally bring the extension host back online
return enterWorkspacePromise.then(() => this.extensionService.startExtensionHost());
});
return TPromise.as(void 0);
}).then(startExtensionHost, startExtensionHost); // in any case start the extension host again!
}
private migrate(toWorkspace: IWorkspaceIdentifier): TPromise<void> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册