mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-27 10:37:38 +01:00
offer reload action when extension host dies
This commit is contained in:
@@ -376,7 +376,7 @@ export class ReloadWindowAction extends Action {
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
ipc.send('vscode:reloadWindow', this.windowService.getWindowId());
|
||||
this.windowService.getWindow().reload();
|
||||
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import {Dimension, Builder, $} from 'vs/base/browser/builder';
|
||||
import objects = require('vs/base/common/objects');
|
||||
import dom = require('vs/base/browser/dom');
|
||||
import aria = require('vs/base/browser/ui/aria/aria');
|
||||
import {Emitter} from 'vs/base/common/event';
|
||||
import {disposeAll, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import {ContextViewService} from 'vs/platform/contextview/browser/contextViewService';
|
||||
@@ -97,11 +96,11 @@ import {IUntitledEditorService, UntitledEditorService} from 'vs/workbench/servic
|
||||
import {CrashReporter} from 'vs/workbench/electron-browser/crashReporter';
|
||||
import {IThemeService, DEFAULT_THEME_ID} from 'vs/workbench/services/themes/common/themeService';
|
||||
import {ThemeService} from 'vs/workbench/services/themes/node/themeService';
|
||||
import { IServiceCtor, isServiceEvent, getService } from 'vs/base/common/service';
|
||||
import { connect, Client } from 'vs/base/node/service.net';
|
||||
import { IExtensionsService } from 'vs/workbench/parts/extensions/common/extensions';
|
||||
import { ExtensionsService } from 'vs/workbench/parts/extensions/node/extensionsService';
|
||||
import { ReloadWindowAction } from 'vs/workbench/electron-browser/actions';
|
||||
import {getService } from 'vs/base/common/service';
|
||||
import {connect} from 'vs/base/node/service.net';
|
||||
import {IExtensionsService} from 'vs/workbench/parts/extensions/common/extensions';
|
||||
import {ExtensionsService} from 'vs/workbench/parts/extensions/node/extensionsService';
|
||||
import {ReloadWindowAction} from 'vs/workbench/electron-browser/actions';
|
||||
|
||||
/**
|
||||
* The Monaco Workbench Shell contains the Monaco workbench with a rich header containing navigation and the activity bar.
|
||||
@@ -163,7 +162,7 @@ export class WorkbenchShell {
|
||||
sharedProcessClientPromise.done(service => {
|
||||
service.onClose(() => {
|
||||
this.messageService.show(Severity.Error, {
|
||||
message: nls.localize('sharedProcessCrashed', "The shared process terminated unexpectedly. Please reload the window."),
|
||||
message: nls.localize('sharedProcessCrashed', "The shared process terminated unexpectedly. Please reload the window to recover."),
|
||||
actions: [instantiationService.createInstance(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL)]
|
||||
});
|
||||
});
|
||||
|
||||
@@ -154,6 +154,10 @@ export class ElectronWindow {
|
||||
this.win.close();
|
||||
}
|
||||
|
||||
public reload(): void {
|
||||
ipc.send('vscode:reloadWindow', this.win.id);
|
||||
}
|
||||
|
||||
public showMessageBox(options: Electron.Dialog.ShowMessageBoxOptions): number {
|
||||
return remote.dialog.showMessageBox(this.win, options);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import {Action} from 'vs/base/common/actions';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import nls = require('vs/nls');
|
||||
import {MainThreadService as CommonMainThreadService} from 'vs/platform/thread/common/mainThreadService';
|
||||
@@ -176,7 +177,7 @@ class PluginHostProcessManager {
|
||||
|
||||
// Support logging from plugin host
|
||||
else if (msg && (<ILogEntry>msg).type === '__$console') {
|
||||
let logEntry:ILogEntry = msg;
|
||||
let logEntry: ILogEntry = msg;
|
||||
|
||||
let args = [];
|
||||
try {
|
||||
@@ -243,7 +244,10 @@ class PluginHostProcessManager {
|
||||
|
||||
// Unexpected termination
|
||||
if (!this.isPluginDevelopmentHost) {
|
||||
this.messageService.show(Severity.Error, nls.localize('pluginHostProcess.crash', "Extension host terminated unexpectedly. Please restart VSCode to recover."));
|
||||
this.messageService.show(Severity.Error, {
|
||||
message: nls.localize('pluginHostProcess.crash', "Extension host terminated unexpectedly. Please reload the window to recover."),
|
||||
actions: [new Action('reloadWindow', nls.localize('reloadWindow', "Reload Window"), null, true, () => { this.windowService.getWindow().reload(); return TPromise.as(null); })]
|
||||
});
|
||||
console.error('Plugin host terminated unexpectedly. Code: ', code, ' Signal: ', signal);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user