Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -12,6 +12,7 @@ import { Emitter } from 'vs/base/common/event';
import { fromEventEmitter } from 'vs/base/node/event';
import { createQueuedSender } from 'vs/base/node/processes';
import { ChannelServer as IPCServer, ChannelClient as IPCClient, IChannelClient, IChannel } from 'vs/base/parts/ipc/common/ipc';
import { isRemoteConsoleLog, log } from 'vs/base/node/console';
export class Server extends IPCServer {
constructor() {
@@ -89,7 +90,7 @@ export class Client implements IChannelClient, IDisposable {
}
getChannel<T extends IChannel>(channelName: string): T {
const call = (command, arg) => this.request(channelName, command, arg);
const call = (command: string, arg: any) => this.request(channelName, command, arg);
return { call } as T;
}
@@ -151,24 +152,15 @@ export class Client implements IChannelClient, IDisposable {
const onRawMessage = fromEventEmitter(this.child, 'message', msg => msg);
onRawMessage(msg => {
// Handle console logs specially
if (msg && msg.type === '__$console') {
let args = ['%c[IPC Library: ' + this.options.serverName + ']', 'color: darkgreen'];
try {
const parsed = JSON.parse(msg.arguments);
args = args.concat(Object.getOwnPropertyNames(parsed).map(o => parsed[o]));
} catch (error) {
args.push(msg.arguments);
}
console[msg.severity].apply(console, args);
// Handle remote console logs specially
if (isRemoteConsoleLog(msg)) {
log(msg, `IPC Library: ${this.options.serverName}`);
return null;
}
// Anything else goes to the outside
else {
onMessageEmitter.fire(msg);
}
onMessageEmitter.fire(msg);
});
const sender = this.options.useQueue ? createQueuedSender(this.child) : this.child;