mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 02:48:30 -05:00
Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)
* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 * disable strict null check
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { spawn, ChildProcess } from 'child_process';
|
||||
import { spawn, ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { buildHelpMessage, buildVersionMessage, addArg, createWaitMarkerFile } from 'vs/platform/environment/node/argv';
|
||||
import { parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
|
||||
@@ -19,13 +19,15 @@ import { resolveTerminalEncoding } from 'vs/base/node/encoding';
|
||||
import * as iconv from 'iconv-lite';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { ProfilingSession, Target } from 'v8-inspect-profiler';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
|
||||
function shouldSpawnCliProcess(argv: ParsedArgs): boolean {
|
||||
return !!argv['install-source']
|
||||
|| !!argv['list-extensions']
|
||||
|| !!argv['install-extension']
|
||||
|| !!argv['uninstall-extension']
|
||||
|| !!argv['locate-extension'];
|
||||
|| !!argv['locate-extension']
|
||||
|| !!argv['telemetry'];
|
||||
}
|
||||
|
||||
interface IMainCli {
|
||||
@@ -57,6 +59,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
else if (shouldSpawnCliProcess(args)) {
|
||||
const cli = await new Promise<IMainCli>((c, e) => require(['vs/code/node/cliProcessMain'], c, e));
|
||||
await cli.main(args);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,7 +127,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
|
||||
const processCallbacks: ((child: ChildProcess) => Promise<any>)[] = [];
|
||||
|
||||
const verbose = args.verbose || args.status || typeof args['upload-logs'] !== 'undefined';
|
||||
const verbose = args.verbose || args.status;
|
||||
if (verbose) {
|
||||
env['ELECTRON_ENABLE_LOGGING'] = '1';
|
||||
|
||||
@@ -257,7 +260,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
addArg(argv, `--prof-startup-prefix`, filenamePrefix);
|
||||
addArg(argv, `--no-cached-data`);
|
||||
|
||||
fs.writeFileSync(filenamePrefix, argv.slice(-6).join('|'));
|
||||
writeFileSync(filenamePrefix, argv.slice(-6).join('|'));
|
||||
|
||||
processCallbacks.push(async _child => {
|
||||
|
||||
@@ -329,7 +332,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
await extHost.stop();
|
||||
|
||||
// re-create the marker file to signal that profiling is done
|
||||
fs.writeFileSync(filenamePrefix, '');
|
||||
writeFileSync(filenamePrefix, '');
|
||||
|
||||
} catch (e) {
|
||||
console.error('Failed to profile startup. Make sure to quit Code first.');
|
||||
@@ -337,21 +340,20 @@ export async function main(argv: string[]): Promise<any> {
|
||||
});
|
||||
}
|
||||
|
||||
if (args['js-flags']) {
|
||||
const match = /max_old_space_size=(\d+)/g.exec(args['js-flags']);
|
||||
const jsFlags = args['js-flags'];
|
||||
if (isString(jsFlags)) {
|
||||
const match = /max_old_space_size=(\d+)/g.exec(jsFlags);
|
||||
if (match && !args['max-memory']) {
|
||||
addArg(argv, `--max-memory=${match[1]}`);
|
||||
}
|
||||
}
|
||||
|
||||
const options = {
|
||||
const options: SpawnOptions = {
|
||||
detached: true,
|
||||
env
|
||||
};
|
||||
|
||||
if (typeof args['upload-logs'] !== 'undefined') {
|
||||
options['stdio'] = ['pipe', 'pipe', 'pipe'];
|
||||
} else if (!verbose) {
|
||||
if (!verbose) {
|
||||
options['stdio'] = 'ignore';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user