Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)

* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973

* disable strict null check
This commit is contained in:
Anthony Dresser
2019-07-15 22:35:46 -07:00
committed by GitHub
parent f720ec642f
commit 0b7e7ddbf9
2406 changed files with 59140 additions and 35464 deletions

View File

@@ -51,9 +51,11 @@ userDefinedLocale.then(locale => {
}
});
// Configure command line switches
// Cached data
const nodeCachedDataDir = getNodeCachedDir();
configureCommandlineSwitches(args, nodeCachedDataDir);
// Configure command line switches
configureCommandlineSwitches(args);
// Load our code once ready
app.once('ready', function () {
@@ -134,31 +136,25 @@ function onReady() {
* @typedef {import('minimist').ParsedArgs} ParsedArgs
*
* @param {ParsedArgs} cliArgs
* @param {{ jsFlags: () => string }} nodeCachedDataDir
*/
function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) {
function configureCommandlineSwitches(cliArgs) {
// Force pre-Chrome-60 color profile handling (for https://github.com/Microsoft/vscode/issues/51791)
app.commandLine.appendSwitch('disable-color-correct-rendering');
// Support JS Flags
const jsFlags = resolveJSFlags(cliArgs, nodeCachedDataDir.jsFlags());
const jsFlags = getJSFlags(cliArgs);
if (jsFlags) {
app.commandLine.appendSwitch('--js-flags', jsFlags);
}
// Disable smooth scrolling for Webviews
if (cliArgs['disable-smooth-scrolling']) {
app.commandLine.appendSwitch('disable-smooth-scrolling');
}
}
/**
* @param {ParsedArgs} cliArgs
* @param {string[]} jsFlags
* @returns {string}
*/
function resolveJSFlags(cliArgs, ...jsFlags) {
function getJSFlags(cliArgs) {
const jsFlags = [];
// Add any existing JS flags we already got from the command line
if (cliArgs['js-flags']) {
@@ -205,7 +201,7 @@ function parseCLIArgs() {
function setCurrentWorkingDirectory() {
try {
if (process.platform === 'win32') {
process.env['VSCODE_CWD'] = process.cwd(); // remember as environment letiable
process.env['VSCODE_CWD'] = process.cwd(); // remember as environment variable
process.chdir(path.dirname(app.getPath('exe'))); // always set application folder as cwd
} else if (process.env['VSCODE_CWD']) {
process.chdir(process.env['VSCODE_CWD']);
@@ -253,7 +249,7 @@ function registerListeners() {
}
/**
* @returns {{ jsFlags: () => string; ensureExists: () => Promise<string | void>, _compute: () => string; }}
* @returns {{ ensureExists: () => Promise<string | void> }}
*/
function getNodeCachedDir() {
return new class {
@@ -262,11 +258,6 @@ function getNodeCachedDir() {
this.value = this._compute();
}
jsFlags() {
// return this.value ? '--nolazy' : undefined;
return undefined;
}
ensureExists() {
return bootstrap.mkdirp(this.value).then(() => this.value, () => { /*ignore*/ });
}
@@ -347,4 +338,4 @@ function getUserDefinedLocale() {
return undefined;
});
}
//#endregion
//#endregion