Vscode merge (#4582)

* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd

* fix issues with merges

* bump node version in azpipe

* replace license headers

* remove duplicate launch task

* fix build errors

* fix build errors

* fix tslint issues

* working through package and linux build issues

* more work

* wip

* fix packaged builds

* working through linux build errors

* wip

* wip

* wip

* fix mac and linux file limits

* iterate linux pipeline

* disable editor typing

* revert series to parallel

* remove optimize vscode from linux

* fix linting issues

* revert testing change

* add work round for new node

* readd packaging for extensions

* fix issue with angular not resolving decorator dependencies
This commit is contained in:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -22,6 +22,7 @@ export interface Option {
id: string;
type: 'boolean' | 'string';
alias?: string;
deprecates?: string; // old deprecated id
args?: string | string[];
description?: string;
cat?: keyof HelpCategories;
@@ -41,7 +42,7 @@ export const options: Option[] = [
{ id: 'folder-uri', type: 'string', cat: 'o', args: 'uri', description: localize('folderUri', "Opens a window with given folder uri(s)") },
{ id: 'file-uri', type: 'string', cat: 'o', args: 'uri', description: localize('fileUri', "Opens a window with given file uri(s)") },
{ id: 'extensions-dir', type: 'string', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
{ id: 'extensions-dir', type: 'string', deprecates: 'extensionHomePath', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
{ id: 'list-extensions', type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") },
{ id: 'show-versions', type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") },
{ id: 'install-extension', type: 'string', cat: 'e', args: 'extension-id', description: localize('installExtension', "Installs or updates the extension. Use `--force` argument to avoid prompts.") },
@@ -53,21 +54,21 @@ export const options: Option[] = [
{ id: 'status', type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") },
{ id: 'prof-modules', type: 'boolean', alias: 'p', cat: 't', description: localize('prof-modules', "Capture performance markers while loading JS modules and print them with 'F1 > Developer: Startup Performance") },
{ id: 'prof-startup', type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") },
{ id: 'disable-extensions', type: 'boolean', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") },
{ id: 'disable-extensions', type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") },
{ id: 'disable-extension', type: 'string', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") },
{ id: 'inspect-extensions', type: 'string', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
{ id: 'inspect-brk-search', type: 'string', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
{ id: 'inspect-extensions', type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
{ id: 'inspect-brk-extensions', type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
{ id: 'disable-gpu', type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
{ id: 'upload-logs', type: 'string', cat: 't', description: localize('uploadLogs', "Uploads logs from current session to a secure endpoint.") },
{ id: 'max-memory', type: 'boolean', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes).") },
{ id: 'max-memory', type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes).") },
{ id: 'remote', type: 'string' },
{ id: 'extensionDevelopmentPath', type: 'string' },
{ id: 'extensionTestsPath', type: 'string' },
{ id: 'debugId', type: 'string' },
{ id: 'inspect-search', type: 'string' },
{ id: 'inspect-brk-extensions', type: 'string' },
{ id: 'inspect-search', type: 'string', deprecates: 'debugSearch' },
{ id: 'inspect-brk-search', type: 'string', deprecates: 'debugBrkSearch' },
{ id: 'export-default-configuration', type: 'string' },
{ id: 'install-source', type: 'string' },
{ id: 'driver', type: 'string' },
@@ -91,9 +92,7 @@ export const options: Option[] = [
{ id: 'trace-category-filter', type: 'string' },
{ id: 'trace-options', type: 'string' },
{ id: 'prof-code-loading', type: 'boolean' },
{ id: 'debugPluginHost', type: 'string', alias: 'inspect-extensions' },
{ id: 'debugBrkPluginHost', type: 'string', alias: 'inspect-brk-extensions' },
{ id: 'nodeless', type: 'boolean' }, // TODO@ben revisit electron5 nodeless support
// {{SQL CARBON EDIT}}
{ id: 'database', type: 'string', alias: 'D' },
@@ -110,13 +109,22 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru
const string: string[] = [];
const boolean: string[] = [];
for (let o of options) {
if (o.alias && isOptionSupported(o)) {
alias[o.id] = o.alias;
if (isOptionSupported(o)) {
if (o.alias) {
alias[o.id] = o.alias;
}
}
if (o.type === 'string') {
string.push(o.id);
if (o.deprecates) {
string.push(o.deprecates);
}
} else if (o.type === 'boolean') {
boolean.push(o.id);
if (o.deprecates) {
boolean.push(o.deprecates);
}
}
}
// remote aliases to avoid confusion
@@ -125,6 +133,10 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru
if (o.alias) {
delete parsedArgs[o.alias];
}
if (o.deprecates && parsedArgs.hasOwnProperty(o.deprecates) && !parsedArgs[o.id]) {
parsedArgs[o.id] = parsedArgs[o.deprecates];
delete parsedArgs[o.deprecates];
}
}
return parsedArgs;
}
@@ -237,3 +249,17 @@ export function hasArgs(arg: string | string[] | undefined): boolean {
}
return false;
}
export function addArg(argv: string[], ...args: string[]): string[] {
const endOfArgsMarkerIndex = argv.indexOf('--');
if (endOfArgsMarkerIndex === -1) {
argv.push(...args);
} else {
// if the we have an argument "--" (end of argument marker)
// we cannot add arguments at the end. rather, we add
// arguments before the "--" marker.
argv.splice(endOfArgsMarkerIndex, 0, ...args);
}
return argv;
}

View File

@@ -4,12 +4,14 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { tmpdir } from 'os';
import { firstIndex } from 'vs/base/common/arrays';
import { localize } from 'vs/nls';
import { ParsedArgs } from '../common/environment';
import { MIN_MAX_MEMORY_SIZE_MB } from 'vs/platform/files/common/files';
import { parseArgs } from 'vs/platform/environment/node/argv';
import { join } from 'vs/base/common/path';
import { writeFile } from 'vs/base/node/pfs';
function validate(args: ParsedArgs): ParsedArgs {
if (args.goto) {
@@ -17,7 +19,7 @@ function validate(args: ParsedArgs): ParsedArgs {
}
if (args['max-memory']) {
assert(args['max-memory'] >= MIN_MAX_MEMORY_SIZE_MB, `The max-memory argument cannot be specified lower than ${MIN_MAX_MEMORY_SIZE_MB} MB.`);
assert(parseInt(args['max-memory']) >= MIN_MAX_MEMORY_SIZE_MB, `The max-memory argument cannot be specified lower than ${MIN_MAX_MEMORY_SIZE_MB} MB.`);
}
return args;
@@ -57,4 +59,22 @@ export function parseCLIProcessArgv(processArgv: string[]): ParsedArgs {
}
return validate(parseArgs(args));
}
}
export function createWaitMarkerFile(verbose?: boolean): Promise<string> {
const randomWaitMarkerPath = join(tmpdir(), Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 10));
return writeFile(randomWaitMarkerPath, '').then(() => {
if (verbose) {
console.log(`Marker file for --wait created: ${randomWaitMarkerPath}`);
}
return randomWaitMarkerPath;
}, error => {
if (verbose) {
console.error(`Failed to create marker file for --wait: ${error}`);
}
return Promise.resolve(undefined);
});
}

View File

@@ -7,10 +7,10 @@ import { IEnvironmentService, ParsedArgs, IDebugParams, IExtensionHostDebugParam
import * as crypto from 'crypto';
import * as paths from 'vs/base/node/paths';
import * as os from 'os';
import * as path from 'path';
import * as path from 'vs/base/common/path';
import { memoize } from 'vs/base/common/decorators';
import pkg from 'vs/platform/node/package';
import product from 'vs/platform/node/product';
import pkg from 'vs/platform/product/node/package';
import product from 'vs/platform/product/node/product';
import { toLocalISOString } from 'vs/base/common/date';
import { isWindows, isLinux } from 'vs/base/common/platform';
import { getPathFromAmdModule } from 'vs/base/common/amd';
@@ -135,7 +135,7 @@ export class EnvironmentService implements IEnvironmentService {
get backupWorkspacesPath(): string { return path.join(this.backupHome, 'workspaces.json'); }
@memoize
get workspacesHome(): string { return path.join(this.userDataPath, 'Workspaces'); }
get untitledWorkspacesHome(): URI { return URI.file(path.join(this.userDataPath, 'Workspaces')); }
@memoize
get installSourcePath(): string { return path.join(this.userDataPath, 'installSource'); }
@@ -184,7 +184,16 @@ export class EnvironmentService implements IEnvironmentService {
}
@memoize
get extensionTestsPath(): string | undefined { return this._args.extensionTestsPath ? path.normalize(this._args.extensionTestsPath) : this._args.extensionTestsPath; }
get extensionTestsLocationURI(): URI | undefined {
const s = this._args.extensionTestsPath;
if (s) {
if (/^[^:/?#]+?:\/\//.test(s)) {
return URI.parse(s);
}
return URI.file(path.normalize(s));
}
return undefined;
}
get disableExtensions(): boolean | string[] {
if (this._args['disable-extensions']) {
@@ -250,11 +259,11 @@ export class EnvironmentService implements IEnvironmentService {
}
export function parseExtensionHostPort(args: ParsedArgs, isBuild: boolean): IExtensionHostDebugParams {
return parseDebugPort(args.debugPluginHost, args.debugBrkPluginHost, 5870, isBuild, args.debugId);
return parseDebugPort(args['inspect-extensions'], args['inspect-brk-extensions'], 5870, isBuild, args.debugId);
}
export function parseSearchPort(args: ParsedArgs, isBuild: boolean): IDebugParams {
return parseDebugPort(args.debugSearch, args.debugBrkSearch, 5876, isBuild);
return parseDebugPort(args['inspect-search'], args['inspect-brk-search'], 5876, isBuild);
}
export function parseDebugPort(debugArg: string | undefined, debugBrkArg: string | undefined, defaultBuildPort: number, isBuild: boolean, debugId?: string): IExtensionHostDebugParams {