mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user