Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -17,7 +17,7 @@ import { CommandOptions, ForkOptions, SuccessData, Source, TerminateResponse, Te
import { getPathFromAmdModule } from 'vs/base/common/amd';
export { CommandOptions, ForkOptions, SuccessData, Source, TerminateResponse, TerminateResponseCode };
export type ValueCallback<T> = (value?: T | Thenable<T>) => void;
export type ValueCallback<T> = (value?: T | Promise<T>) => void;
export type ErrorCallback = (error?: any) => void;
export type ProgressCallback<T> = (progress: T) => void;
@@ -72,6 +72,26 @@ export function getWindowsShell(): string {
return process.env['comspec'] || 'cmd.exe';
}
/**
* Sanitizes a VS Code process environment by removing all Electron/VS Code-related values.
*/
export function sanitizeProcessEnvironment(env: Platform.IProcessEnvironment): void {
const keysToRemove = [
/^ELECTRON_.+$/,
/^GOOGLE_API_KEY$/,
/^VSCODE_.+$/
];
const envKeys = Object.keys(env);
envKeys.forEach(envKey => {
for (let i = 0; i < keysToRemove.length; i++) {
if (envKey.search(keysToRemove[i]) !== -1) {
delete env[envKey];
break;
}
}
});
}
export abstract class AbstractProcess<TProgressData> {
private cmd: string;
private args: string[];
@@ -107,7 +127,7 @@ export abstract class AbstractProcess<TProgressData> {
public constructor(executable: Executable);
public constructor(cmd: string, args: string[] | undefined, shell: boolean, options: CommandOptions | undefined);
public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean, arg4?: CommandOptions) {
if (arg2 !== void 0 && arg3 !== void 0 && arg4 !== void 0) {
if (arg2 !== undefined && arg3 !== undefined && arg4 !== undefined) {
this.cmd = <string>arg1;
this.args = arg2;
this.shell = arg3;
@@ -409,7 +429,7 @@ export namespace win32 {
if (path.isAbsolute(command)) {
return command;
}
if (cwd === void 0) {
if (cwd === undefined) {
cwd = process.cwd();
}
let dir = path.dirname(command);
@@ -418,11 +438,11 @@ export namespace win32 {
// to the current working directory.
return path.join(cwd, command);
}
if (paths === void 0 && Types.isString(process.env.PATH)) {
if (paths === undefined && Types.isString(process.env.PATH)) {
paths = process.env.PATH.split(path.delimiter);
}
// No PATH environment. Make path absolute to the cwd.
if (paths === void 0 || paths.length === 0) {
if (paths === undefined || paths.length === 0) {
return path.join(cwd, command);
}
// We have a simple file name. We get the path variable from the env