Merge from vscode f2d41726ba5a0e8abfe61b2c743022b1b6372010 (#7415)

* Merge from vscode f2d41726ba5a0e8abfe61b2c743022b1b6372010

* add missing files
This commit is contained in:
Anthony Dresser
2019-09-27 23:30:36 -07:00
committed by GitHub
parent d0fb6de390
commit bca7c8e6bd
123 changed files with 1704 additions and 1330 deletions

View File

@@ -14,7 +14,8 @@ import { mkdirp } from 'vs/base/node/pfs';
import { validatePaths } from 'vs/code/node/paths';
import { LifecycleMainService, ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService';
import { Server, serve, connect } from 'vs/base/parts/ipc/node/ipc.net';
import { LaunchChannelClient } from 'vs/platform/launch/electron-main/launchMainService';
import { createChannelSender } from 'vs/base/parts/ipc/node/ipc';
import { ILaunchMainService } from 'vs/platform/launch/electron-main/launchMainService';
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
@@ -272,8 +273,7 @@ class CodeMain {
}, 10000);
}
const channel = client.getChannel('launch');
const launchClient = new LaunchChannelClient(channel);
const launchService = createChannelSender<ILaunchMainService>(client.getChannel('launch'), { disableMarshalling: true });
// Process Info
if (environmentService.args.status) {
@@ -282,8 +282,8 @@ class CodeMain {
const sharedProcessClient = await connect(environmentService.sharedIPCHandle, 'main');
const diagnosticsChannel = sharedProcessClient.getChannel('diagnostics');
const diagnosticsService = new DiagnosticsService(diagnosticsChannel);
const mainProcessInfo = await launchClient.getMainProcessInfo();
const remoteDiagnostics = await launchClient.getRemoteDiagnostics({ includeProcesses: true, includeWorkspaceMetadata: true });
const mainProcessInfo = await launchService.getMainProcessInfo();
const remoteDiagnostics = await launchService.getRemoteDiagnostics({ includeProcesses: true, includeWorkspaceMetadata: true });
const diagnostics = await diagnosticsService.getDiagnostics(mainProcessInfo, remoteDiagnostics);
console.log(diagnostics);
@@ -293,12 +293,12 @@ class CodeMain {
// Windows: allow to set foreground
if (platform.isWindows) {
await this.windowsAllowSetForegroundWindow(launchClient, logService);
await this.windowsAllowSetForegroundWindow(launchService, logService);
}
// Send environment over...
logService.trace('Sending env to running instance...');
await launchClient.start(environmentService.args, process.env as platform.IProcessEnvironment);
await launchService.start(environmentService.args, process.env as platform.IProcessEnvironment);
// Cleanup
await client.dispose();
@@ -360,9 +360,9 @@ class CodeMain {
});
}
private async windowsAllowSetForegroundWindow(client: LaunchChannelClient, logService: ILogService): Promise<void> {
private async windowsAllowSetForegroundWindow(launchService: ILaunchMainService, logService: ILogService): Promise<void> {
if (platform.isWindows) {
const processId = await client.getMainProcessId();
const processId = await launchService.getMainProcessId();
logService.trace('Sending some foreground love to the running instance:', processId);