Initial VS Code 1.19 source merge (#571)

* Initial 1.19 xcopy

* Fix yarn build

* Fix numerous build breaks

* Next batch of build break fixes

* More build break fixes

* Runtime breaks

* Additional post merge fixes

* Fix windows setup file

* Fix test failures.

* Update license header blocks to refer to source eula
This commit is contained in:
Karl Burtram
2018-01-28 23:37:17 -08:00
committed by GitHub
parent 9a1ac20710
commit 251ae01c3e
8009 changed files with 93378 additions and 35634 deletions

View File

@@ -9,7 +9,6 @@ import * as cp from 'child_process';
import ChildProcess = cp.ChildProcess;
import exec = cp.exec;
import spawn = cp.spawn;
import { PassThrough } from 'stream';
import { fork } from 'vs/base/node/stdFork';
import nls = require('vs/nls');
import { PPromise, TPromise, TValueCallback, TProgressCallback, ErrorCallback } from 'vs/base/common/winjs.base';
@@ -28,17 +27,6 @@ export interface LineData {
source: Source;
}
export interface BufferData {
data: Buffer;
source: Source;
}
export interface StreamData {
stdin: NodeJS.WritableStream;
stdout: NodeJS.ReadableStream;
stderr: NodeJS.ReadableStream;
}
function getWindowsCode(status: number): TerminateResponseCode {
switch (status) {
case 0:
@@ -212,7 +200,7 @@ export abstract class AbstractProcess<TProgressData> {
cc(result);
};
if (this.shell && Platform.isWindows) {
let options: any = Objects.clone(this.options);
let options: any = Objects.deepClone(this.options);
options.windowsVerbatimArguments = true;
options.detached = false;
let quotedCommand: boolean = false;
@@ -287,7 +275,7 @@ export abstract class AbstractProcess<TProgressData> {
// Default is to do nothing.
}
private static regexp = /^[^"].* .*[^"]/;
private static readonly regexp = /^[^"].* .*[^"]/;
private ensureQuotes(value: string) {
if (AbstractProcess.regexp.test(value)) {
return {
@@ -302,10 +290,6 @@ export abstract class AbstractProcess<TProgressData> {
}
}
public isRunning(): boolean {
return this.childProcessPromise !== null;
}
public get pid(): TPromise<number> {
return this.childProcessPromise.then(childProcess => childProcess.pid, err => -1);
}
@@ -391,60 +375,6 @@ export class LineProcess extends AbstractProcess<LineData> {
}
}
export class BufferProcess extends AbstractProcess<BufferData> {
public constructor(executable: Executable);
public constructor(cmd: string, args: string[], shell: boolean, options: CommandOptions);
public constructor(module: string, args: string[], options: ForkOptions);
public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean | ForkOptions, arg4?: CommandOptions) {
super(<any>arg1, arg2, <any>arg3, arg4);
}
protected handleExec(cc: TValueCallback<SuccessData>, pp: TProgressCallback<BufferData>, error: Error, stdout: Buffer, stderr: Buffer): void {
pp({ data: stdout, source: Source.stdout });
pp({ data: stderr, source: Source.stderr });
cc({ terminated: this.terminateRequested, error: error });
}
protected handleSpawn(childProcess: ChildProcess, cc: TValueCallback<SuccessData>, pp: TProgressCallback<BufferData>, ee: ErrorCallback, sync: boolean): void {
childProcess.stdout.on('data', (data: Buffer) => {
pp({ data: data, source: Source.stdout });
});
childProcess.stderr.on('data', (data: Buffer) => {
pp({ data: data, source: Source.stderr });
});
}
}
export class StreamProcess extends AbstractProcess<StreamData> {
public constructor(executable: Executable);
public constructor(cmd: string, args: string[], shell: boolean, options: CommandOptions);
public constructor(module: string, args: string[], options: ForkOptions);
public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean | ForkOptions, arg4?: CommandOptions) {
super(<any>arg1, arg2, <any>arg3, arg4);
}
protected handleExec(cc: TValueCallback<SuccessData>, pp: TProgressCallback<StreamData>, error: Error, stdout: Buffer, stderr: Buffer): void {
let stdoutStream = new PassThrough();
stdoutStream.end(stdout);
let stderrStream = new PassThrough();
stderrStream.end(stderr);
pp({ stdin: null, stdout: stdoutStream, stderr: stderrStream });
cc({ terminated: this.terminateRequested, error: error });
}
protected handleSpawn(childProcess: ChildProcess, cc: TValueCallback<SuccessData>, pp: TProgressCallback<StreamData>, ee: ErrorCallback, sync: boolean): void {
if (sync) {
process.nextTick(() => {
pp({ stdin: childProcess.stdin, stdout: childProcess.stdout, stderr: childProcess.stderr });
});
} else {
pp({ stdin: childProcess.stdin, stdout: childProcess.stdout, stderr: childProcess.stderr });
}
}
}
export interface IQueuedSender {
send: (msg: any) => void;
}