code-server/packages/vscode/src/fill/stdioElectron.ts
Asher 6708c8a5c8
Prevent shared process from loading client code
I think this happened when I added the trash code, since that's what
includes the client.
2019-02-19 17:58:17 -06:00

28 lines
1006 B
TypeScript

import { StdioIpcHandler } from "@coder/server/src/ipc";
import { IpcRenderer } from "electron";
// TODO: Commenting out for now since the electron fill includes the client code
// and tries to connect to the web socket. The fill also likely wouldn't work
// since it assumes it is running on the client. Could we proxy all methods to
// the client? It might not matter since we intercept everything before sending
// to the shared process.
// export * from "@coder/ide/src/fill/electron";
class StdioIpcRenderer extends StdioIpcHandler implements IpcRenderer {
// tslint:disable-next-line no-any
public sendTo(_windowId: number, _channel: string, ..._args: any[]): void {
throw new Error("Method not implemented.");
}
// tslint:disable-next-line no-any
public sendToHost(_channel: string, ..._args: any[]): void {
throw new Error("Method not implemented.");
}
public eventNames(): string[] {
return super.eventNames() as string[];
}
}
export const ipcRenderer = new StdioIpcRenderer();