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

fix ipc: now has event as first arg on renderer side

上级 c5f13122
...@@ -49,12 +49,12 @@ export class ElectronIntegration { ...@@ -49,12 +49,12 @@ export class ElectronIntegration {
this.windowService.registerWindow(activeWindow); this.windowService.registerWindow(activeWindow);
// Support runAction event // Support runAction event
ipc.on('vscode:runAction', (actionId: string) => { ipc.on('vscode:runAction', (event, actionId: string) => {
this.keybindingService.executeCommand(actionId, { from: 'menu' }).done(undefined, err => this.messageService.show(Severity.Error, err)); this.keybindingService.executeCommand(actionId, { from: 'menu' }).done(undefined, err => this.messageService.show(Severity.Error, err));
}); });
// Support options change // Support options change
ipc.on('vscode:optionsChange', (options: string) => { ipc.on('vscode:optionsChange', (event, options: string) => {
let optionsData = JSON.parse(options); let optionsData = JSON.parse(options);
for (let key in optionsData) { for (let key in optionsData) {
if (optionsData.hasOwnProperty(key)) { if (optionsData.hasOwnProperty(key)) {
...@@ -65,7 +65,7 @@ export class ElectronIntegration { ...@@ -65,7 +65,7 @@ export class ElectronIntegration {
}); });
// Support resolve keybindings event // Support resolve keybindings event
ipc.on('vscode:resolveKeybindings', (rawActionIds: string) => { ipc.on('vscode:resolveKeybindings', (event, rawActionIds: string) => {
let actionIds: string[] = []; let actionIds: string[] = [];
try { try {
actionIds = JSON.parse(rawActionIds); actionIds = JSON.parse(rawActionIds);
...@@ -81,11 +81,11 @@ export class ElectronIntegration { ...@@ -81,11 +81,11 @@ export class ElectronIntegration {
}, () => errors.onUnexpectedError); }, () => errors.onUnexpectedError);
}); });
ipc.on('vscode:telemetry', ({ eventName, data }) => { ipc.on('vscode:telemetry', (event, { eventName, data }) => {
this.telemetryService.publicLog(eventName, data); this.telemetryService.publicLog(eventName, data);
}); });
ipc.on('vscode:reportError', (error) => { ipc.on('vscode:reportError', (event, error) => {
if (error) { if (error) {
let errorParsed = JSON.parse(error); let errorParsed = JSON.parse(error);
errorParsed.mainProcess = true; errorParsed.mainProcess = true;
...@@ -99,7 +99,7 @@ export class ElectronIntegration { ...@@ -99,7 +99,7 @@ export class ElectronIntegration {
}); });
// Theme changes // Theme changes
ipc.on('vscode:changeTheme', (theme: string) => { ipc.on('vscode:changeTheme', (event, theme: string) => {
this.storageService.store('workbench.theme', theme, StorageScope.GLOBAL); this.storageService.store('workbench.theme', theme, StorageScope.GLOBAL);
}); });
......
...@@ -57,7 +57,7 @@ export class Update { ...@@ -57,7 +57,7 @@ export class Update {
) { ) {
const env = this.contextService.getConfiguration().env; const env = this.contextService.getConfiguration().env;
ipc.on('vscode:update-downloaded', (update: IUpdate) => { ipc.on('vscode:update-downloaded', (event, update: IUpdate) => {
this.messageService.show(severity.Info, { this.messageService.show(severity.Info, {
message: nls.localize('updateAvailable', "{0} will be updated after it restarts.", env.appName), message: nls.localize('updateAvailable', "{0} will be updated after it restarts.", env.appName),
actions: [Update.ShowReleaseNotesAction(env.releaseNotesUrl), Update.NotNowAction, Update.ApplyUpdateAction] actions: [Update.ShowReleaseNotesAction(env.releaseNotesUrl), Update.NotNowAction, Update.ApplyUpdateAction]
......
...@@ -83,7 +83,7 @@ export class ExtensionsWorkbenchExtension implements IWorkbenchContribution { ...@@ -83,7 +83,7 @@ export class ExtensionsWorkbenchExtension implements IWorkbenchContribution {
} }
private registerListeners(): void { private registerListeners(): void {
ipc.on('vscode:installExtensions', (request: IInstallExtensionsRequest) => { ipc.on('vscode:installExtensions', (event, request: IInstallExtensionsRequest) => {
if (request.extensionsToInstall) { if (request.extensionsToInstall) {
this.install(request.extensionsToInstall).done(null, errors.onUnexpectedError); this.install(request.extensionsToInstall).done(null, errors.onUnexpectedError);
} }
......
...@@ -82,7 +82,7 @@ export class FileTracker implements IWorkbenchContribution { ...@@ -82,7 +82,7 @@ export class FileTracker implements IWorkbenchContribution {
this.toUnbind.push(() => disposable.dispose()); this.toUnbind.push(() => disposable.dispose());
// Support openFiles event for existing and new files // Support openFiles event for existing and new files
ipc.on('vscode:openFiles', (request: IOpenFileRequest) => { ipc.on('vscode:openFiles', (event, request: IOpenFileRequest) => {
let inputs: IResourceInput[] = []; let inputs: IResourceInput[] = [];
if (request.filesToOpen) { if (request.filesToOpen) {
inputs.push(...this.toInputs(request.filesToOpen, false)); inputs.push(...this.toInputs(request.filesToOpen, false));
......
...@@ -30,7 +30,6 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; ...@@ -30,7 +30,6 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {IConfigurationService, IConfigurationServiceEvent, ConfigurationServiceEventTypes} from 'vs/platform/configuration/common/configuration'; import {IConfigurationService, IConfigurationServiceEvent, ConfigurationServiceEventTypes} from 'vs/platform/configuration/common/configuration';
import remote = require('remote'); import remote = require('remote');
import {ipcRenderer as ipc} from 'electron';
const Dialog = remote.require('dialog'); const Dialog = remote.require('dialog');
......
...@@ -20,7 +20,6 @@ import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle'; ...@@ -20,7 +20,6 @@ import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import remote = require('remote'); import remote = require('remote');
import {ipcRenderer as ipc} from 'electron';
import fs = require('fs'); import fs = require('fs');
export class SnippetsTracker implements workbenchExt.IWorkbenchContribution { export class SnippetsTracker implements workbenchExt.IWorkbenchContribution {
......
...@@ -28,7 +28,7 @@ export class LifecycleService extends BaseLifecycleService { ...@@ -28,7 +28,7 @@ export class LifecycleService extends BaseLifecycleService {
let windowId = this.windowService.getWindowId(); let windowId = this.windowService.getWindowId();
// Main side indicates that window is about to unload, check for vetos // Main side indicates that window is about to unload, check for vetos
ipc.on('vscode:beforeUnload', (reply: { okChannel: string, cancelChannel: string }) => { ipc.on('vscode:beforeUnload', (event, reply: { okChannel: string, cancelChannel: string }) => {
let veto = this.beforeUnload(); let veto = this.beforeUnload();
if (typeof veto === 'boolean') { if (typeof veto === 'boolean') {
......
...@@ -50,7 +50,7 @@ export class WindowService implements IWindowService { ...@@ -50,7 +50,7 @@ export class WindowService implements IWindowService {
} }
private registerListeners(): void { private registerListeners(): void {
ipc.on('vscode:broadcast', (b: IBroadcast) => { ipc.on('vscode:broadcast', (event, b: IBroadcast) => {
this._onBroadcast.fire(b); this._onBroadcast.fire(b);
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册