Merge from vscode 2cd495805cf99b31b6926f08ff4348124b2cf73d

This commit is contained in:
ADS Merger
2020-06-30 04:40:21 +00:00
committed by AzureDataStudio
parent a8a7559229
commit 1388493cc1
602 changed files with 16375 additions and 12940 deletions

View File

@@ -3,6 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path="../../../../typings/require.d.ts" />
//@ts-check
'use strict';
@@ -31,11 +33,17 @@ const perf = (function () {
perf.mark('renderer/started');
const bootstrapWindow = require('../../../../bootstrap-window');
// Setup shell environment
process['lazyEnv'] = getLazyEnv();
/**
* @type {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options: object) => unknown }}
*/
const bootstrapWindow = (() => {
// @ts-ignore (defined in bootstrap-window.js)
return window.MonacoBootstrapWindow;
})();
// Load workbench main JS, CSS and NLS all in parallel. This is an
// optimization to prevent a waterfall of loading to happen, because
// we know for a fact that workbench.desktop.main will depend on
@@ -55,18 +63,20 @@ bootstrapWindow.load([
// @ts-ignore
return require('vs/workbench/electron-browser/desktop.main').main(configuration);
});
}, {
removeDeveloperKeybindingsAfterLoad: true,
canModifyDOM: function (windowConfig) {
showPartsSplash(windowConfig);
},
beforeLoaderConfig: function (windowConfig, loaderConfig) {
loaderConfig.recordStats = true;
},
beforeRequire: function () {
perf.mark('willLoadWorkbenchMain');
{
removeDeveloperKeybindingsAfterLoad: true,
canModifyDOM: function (windowConfig) {
showPartsSplash(windowConfig);
},
beforeLoaderConfig: function (windowConfig, loaderConfig) {
loaderConfig.recordStats = true;
},
beforeRequire: function () {
perf.mark('willLoadWorkbenchMain');
}
}
});
);
/**
* @param {{
@@ -84,7 +94,7 @@ function showPartsSplash(configuration) {
let data;
if (typeof configuration.partsSplashPath === 'string') {
try {
data = JSON.parse(require('fs').readFileSync(configuration.partsSplashPath, 'utf8'));
data = JSON.parse(require.__$__nodeRequire('fs').readFileSync(configuration.partsSplashPath, 'utf8'));
} catch (e) {
// ignore
}
@@ -173,7 +183,7 @@ function showPartsSplash(configuration) {
*/
function getLazyEnv() {
const ipc = require('electron').ipcRenderer;
const ipc = require.__$__nodeRequire('electron').ipcRenderer;
return new Promise(function (resolve) {
const handle = setTimeout(function () {
@@ -183,7 +193,7 @@ function getLazyEnv() {
ipc.once('vscode:acceptShellEnv', function (event, shellEnv) {
clearTimeout(handle);
bootstrapWindow.assign(process.env, shellEnv);
Object.assign(process.env, shellEnv);
// @ts-ignore
resolve(process.env);
});