Update to VS Code 1.52.1

This commit is contained in:
Asher
2021-02-09 16:08:37 +00:00
1351 changed files with 56560 additions and 38990 deletions

View File

@ -15,6 +15,7 @@ const path = require('path');
const fs = require('fs');
const os = require('os');
const bootstrap = require('./bootstrap');
const bootstrapNode = require('./bootstrap-node');
const paths = require('./paths');
/** @type {any} */
const product = require('../product.json');
@ -25,10 +26,10 @@ const { app, protocol, crashReporter } = require('electron');
app.allowRendererProcessReuse = false;
// Enable portable support
const portable = bootstrap.configurePortable(product);
const portable = bootstrapNode.configurePortable(product);
// Enable ASAR support
bootstrap.enableASARSupport();
bootstrap.enableASARSupport(undefined);
// Set userData path before app 'ready' event
const args = parseCLIArgs();
@ -107,7 +108,7 @@ crashReporter.start({
// to ensure that no 'logs' folder is created on disk at a
// location outside of the portable directory
// (https://github.com/microsoft/vscode/issues/56651)
if (portable.isPortable) {
if (portable && portable.isPortable) {
app.setAppLogsPath(path.join(userDataPath, 'logs'));
}
@ -133,6 +134,15 @@ protocol.registerSchemesAsPrivileged([
corsEnabled: true,
}
},
{
scheme: 'vscode-file',
privileges: {
secure: true,
standard: true,
supportFetchAPI: true,
corsEnabled: true
}
}
]);
// Global app listeners
@ -145,7 +155,7 @@ const nodeCachedDataDir = getNodeCachedDir();
* Support user defined locale: load it early before app('ready')
* to have more things running in parallel.
*
* @type {Promise<import('./vs/base/node/languagePacks').NLSConfiguration>} nlsConfig | undefined
* @type {Promise<import('./vs/base/node/languagePacks').NLSConfiguration> | undefined}
*/
let nlsConfigurationPromise = undefined;
@ -359,7 +369,7 @@ function getArgvConfigPath() {
/**
* @param {NativeParsedArgs} cliArgs
* @returns {string}
* @returns {string | null}
*/
function getJSFlags(cliArgs) {
const jsFlags = [];
@ -387,7 +397,7 @@ function getUserDataPath(cliArgs) {
return path.join(portable.portableDataPath, 'user-data');
}
return path.resolve(cliArgs['user-data-dir'] || paths.getDefaultUserDataPath(process.platform));
return path.resolve(cliArgs['user-data-dir'] || paths.getDefaultUserDataPath());
}
/**
@ -468,12 +478,14 @@ function getNodeCachedDir() {
}
async ensureExists() {
try {
await mkdirp(this.value);
if (typeof this.value === 'string') {
try {
await mkdirp(this.value);
return this.value;
} catch (error) {
// ignore
return this.value;
} catch (error) {
// ignore
}
}
}