remove IConsolePatchFn function

This commit is contained in:
Johannes Rieken
2019-08-12 15:04:02 +02:00
parent 8ed95311cd
commit 58a32d0b44
4 changed files with 11 additions and 25 deletions

View File

@@ -43,6 +43,16 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
// Do this when extension service exists, but extensions are not being activated yet.
await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._logService, this._mainThreadTelemetryProxy);
// Use IPC messages to forward console-calls, note that the console is
// already patched to use`process.send()`
const nativeProcessSend = process.send!;
const mainThreadConsole = this._extHostContext.getProxy(MainContext.MainThreadConsole);
process.send = (...args: any[]) => {
if (args.length === 0 || !args[0] || args[0].type !== '__$console') {
return nativeProcessSend.apply(process, args);
}
mainThreadConsole.$logExtensionHostMessage(args[0]);
};
}
protected _loadCommonJSModule<T>(modulePath: string, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T> {