mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 (#14883)
* Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 * Bump distro * Upgrade GCC to 4.9 due to yarn install errors * Update build image * Fix bootstrap base url * Bump distro * Fix build errors * Update source map file * Disable checkbox for blocking migration issues (#15131) * disable checkbox for blocking issues * wip * disable checkbox fixes * fix strings * Remove duplicate tsec command * Default to off for tab color if settings not present * re-skip failing tests * Fix mocha error * Bump sqlite version & fix notebooks search view * Turn off esbuild warnings * Update esbuild log level * Fix overflowactionbar tests * Fix ts-ignore in dropdown tests * cleanup/fixes * Fix hygiene * Bundle in entire zone.js module * Remove extra constructor param * bump distro for web compile break * bump distro for web compile break v2 * Undo log level change * New distro * Fix integration test scripts * remove the "no yarn.lock changes" workflow * fix scripts v2 * Update unit test scripts * Ensure ads-kerberos2 updates in .vscodeignore * Try fix unit tests * Upload crash reports * remove nogpu * always upload crashes * Use bash script * Consolidate data/ext dir names * Create in tmp directory Co-authored-by: chlafreniere <hichise@gmail.com> Co-authored-by: Christopher Suh <chsuh@microsoft.com> Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
101
src/bootstrap.js
vendored
101
src/bootstrap.js
vendored
@@ -16,11 +16,7 @@
|
||||
|
||||
// Browser
|
||||
else {
|
||||
try {
|
||||
globalThis.MonacoBootstrap = factory();
|
||||
} catch (error) {
|
||||
console.warn(error); // expected when e.g. running with sandbox: true (TODO@sandbox eventually consolidate this)
|
||||
}
|
||||
globalThis.MonacoBootstrap = factory();
|
||||
}
|
||||
}(this, function () {
|
||||
const Module = typeof require === 'function' ? require('module') : undefined;
|
||||
@@ -174,94 +170,9 @@
|
||||
return nlsConfig;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region Portable helpers
|
||||
|
||||
/**
|
||||
* @param {{ portable: string | undefined; applicationName: string; }} product
|
||||
* @returns {{ portableDataPath: string; isPortable: boolean; } | undefined}
|
||||
* @returns {typeof import('./vs/base/parts/sandbox/electron-sandbox/globals') | undefined}
|
||||
*/
|
||||
function configurePortable(product) {
|
||||
if (!path || !fs || typeof process === 'undefined') {
|
||||
console.warn('configurePortable() is only available in node.js environments'); // TODO@sandbox Portable is currently non-sandboxed only
|
||||
return;
|
||||
}
|
||||
|
||||
const appRoot = path.dirname(__dirname);
|
||||
|
||||
/**
|
||||
* @param {import('path')} path
|
||||
*/
|
||||
function getApplicationPath(path) {
|
||||
if (process.env['VSCODE_DEV']) {
|
||||
return appRoot;
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
return path.dirname(path.dirname(path.dirname(appRoot)));
|
||||
}
|
||||
|
||||
return path.dirname(path.dirname(appRoot));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('path')} path
|
||||
*/
|
||||
function getPortableDataPath(path) {
|
||||
if (process.env['VSCODE_PORTABLE']) {
|
||||
return process.env['VSCODE_PORTABLE'];
|
||||
}
|
||||
|
||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||
return path.join(getApplicationPath(path), 'data');
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
const portableDataName = product.portable || `${product.applicationName}-portable-data`;
|
||||
return path.join(path.dirname(getApplicationPath(path)), portableDataName);
|
||||
}
|
||||
|
||||
const portableDataPath = getPortableDataPath(path);
|
||||
const isPortable = !('target' in product) && fs.existsSync(portableDataPath);
|
||||
const portableTempPath = path.join(portableDataPath, 'tmp');
|
||||
const isTempPortable = isPortable && fs.existsSync(portableTempPath);
|
||||
|
||||
if (isPortable) {
|
||||
process.env['VSCODE_PORTABLE'] = portableDataPath;
|
||||
} else {
|
||||
delete process.env['VSCODE_PORTABLE'];
|
||||
}
|
||||
|
||||
if (isTempPortable) {
|
||||
if (process.platform === 'win32') {
|
||||
process.env['TMP'] = portableTempPath;
|
||||
process.env['TEMP'] = portableTempPath;
|
||||
} else {
|
||||
process.env['TMPDIR'] = portableTempPath;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
portableDataPath,
|
||||
isPortable
|
||||
};
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region ApplicationInsights
|
||||
|
||||
// Prevents appinsights from monkey patching modules.
|
||||
// This should be called before importing the applicationinsights module
|
||||
function avoidMonkeyPatchFromAppInsights() {
|
||||
// @ts-ignore
|
||||
process.env['APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL'] = true; // Skip monkey patching of 3rd party modules by appinsights
|
||||
global['diagnosticsSource'] = {}; // Prevents diagnostic channel (which patches "require") from initializing entirely
|
||||
}
|
||||
|
||||
function safeGlobals() {
|
||||
const globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {});
|
||||
|
||||
@@ -269,7 +180,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {NodeJS.Process | undefined}
|
||||
* @returns {import('./vs/base/parts/sandbox/electron-sandbox/globals').IPartialNodeProcess | NodeJS.Process}
|
||||
*/
|
||||
function safeProcess() {
|
||||
if (typeof process !== 'undefined') {
|
||||
@@ -280,16 +191,20 @@
|
||||
if (globals) {
|
||||
return globals.process; // Native environment (sandboxed)
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Electron.IpcRenderer | undefined}
|
||||
* @returns {import('./vs/base/parts/sandbox/electron-sandbox/electronTypes').IpcRenderer | undefined}
|
||||
*/
|
||||
function safeIpcRenderer() {
|
||||
const globals = safeGlobals();
|
||||
if (globals) {
|
||||
return globals.ipcRenderer;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user