mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-27 13:16:59 +00:00
Remove unneeded file, document channels
This commit is contained in:
@@ -1066,7 +1066,6 @@ export namespace ProxyChannel {
|
||||
return new class implements IServerChannel {
|
||||
|
||||
listen<T>(_: unknown, event: string): Event<T> {
|
||||
console.log('fromService listen', event);
|
||||
const eventImpl = mapEventNameToEvent.get(event);
|
||||
if (eventImpl) {
|
||||
return eventImpl as Event<T>;
|
||||
|
||||
@@ -81,7 +81,6 @@ import { DeprecatedExtensionsCleaner } from 'vs/code/electron-browser/sharedProc
|
||||
import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { LocalPtyChannel } from 'vs/platform/terminal/electron-browser/terminalIpc';
|
||||
import { TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
||||
import { LocalPtyService } from 'vs/platform/terminal/electron-browser/localPtyService';
|
||||
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
||||
@@ -264,7 +263,6 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService));
|
||||
|
||||
// Terminal
|
||||
// TODO: Move out of electron-main
|
||||
services.set(ILocalPtyService, new SyncDescriptor(LocalPtyService));
|
||||
|
||||
return new InstantiationService(services);
|
||||
|
||||
@@ -8,7 +8,14 @@ import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export enum TerminalIpcChannels {
|
||||
LocalPty = 'localPty'
|
||||
/**
|
||||
* Communicates between the renderer process and shared process.
|
||||
*/
|
||||
LocalPty = 'localPty',
|
||||
/**
|
||||
* Communicates between the shared process and the pty host process.
|
||||
*/
|
||||
PtyHost = 'ptyHost'
|
||||
}
|
||||
|
||||
export interface ILocalPtyService {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILocalPtyService, IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError } from 'vs/platform/terminal/common/terminal';
|
||||
import { ILocalPtyService, IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
||||
import { Client } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
@@ -65,7 +65,7 @@ export class LocalPtyService extends Disposable implements ILocalPtyService {
|
||||
// }
|
||||
}));
|
||||
|
||||
this._proxy = ProxyChannel.toService(client.getChannel('ptyHost'));
|
||||
this._proxy = ProxyChannel.toService(client.getChannel(TerminalIpcChannels.PtyHost));
|
||||
this._register(this._proxy.onProcessData(e => this._onProcessData.fire(e)));
|
||||
this._register(this._proxy.onProcessExit(e => this._onProcessExit.fire(e)));
|
||||
this._register(this._proxy.onProcessReady(e => this._onProcessReady.fire(e)));
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IServerChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { ILocalPtyService } from 'vs/platform/terminal/common/terminal';
|
||||
|
||||
export class LocalPtyChannel extends Disposable implements IServerChannel {
|
||||
constructor(
|
||||
private readonly _localPtyService: ILocalPtyService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
listen(_: unknown, event: string): Event<any> {
|
||||
console.log('LocalPtyChannel listen ' + event);
|
||||
throw new Error(`Event not found: ${event}`);
|
||||
}
|
||||
|
||||
async call(_: unknown, command: string, arg?: any): Promise<any> {
|
||||
switch (command) {
|
||||
case 'createProcess': return this._localPtyService.createProcess(...arg as [any, any, any, any, any, any, any]);
|
||||
case 'start': return this._localPtyService.start(...(arg as [any]));
|
||||
// TODO: Fill in other calls
|
||||
|
||||
default:
|
||||
throw new Error(`Call not found: ${command}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
import { Server } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||
import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { PtyService } from 'vs/platform/terminal/node/ptyHost/ptyService';
|
||||
import { TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
||||
|
||||
const server = new Server('ptyHost');
|
||||
const service = new PtyService();
|
||||
server.registerChannel('ptyHost', ProxyChannel.fromService(service));
|
||||
server.registerChannel(TerminalIpcChannels.PtyHost, ProxyChannel.fromService(service));
|
||||
|
||||
@@ -37,7 +37,6 @@ export class PtyService extends Disposable implements ILocalPtyService {
|
||||
|
||||
async createProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, executableEnv: IProcessEnvironment, windowsEnableConpty: boolean): Promise<number> {
|
||||
const id = ++currentPtyId;
|
||||
console.log('PtyMainService#createProcess ' + id, shellLaunchConfig, cwd, cols);
|
||||
// TODO: Impl proper logging, level doesn't get passed over
|
||||
const process = new TerminalProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, windowsEnableConpty, new LogService(new ConsoleLogger()));
|
||||
process.onProcessData(event => this._onProcessData.fire({ id, event }));
|
||||
|
||||
Reference in New Issue
Block a user