VS Code merge to df8fe74bd55313de0dd2303bc47a4aab0ca56b0e (#17979)

* Merge from vscode 504f934659740e9d41501cad9f162b54d7745ad9

* delete unused folders

* distro

* Bump build node version

* update chokidar

* FIx hygiene errors

* distro

* Fix extension lint issues

* Remove strict-vscode

* Add copyright header exemptions

* Bump vscode-extension-telemetry to fix webpacking issue with zone.js

* distro

* Fix failing tests (revert marked.js back to current one until we decide to update)

* Skip searchmodel test

* Fix mac build

* temp debug script loading

* Try disabling coverage

* log error too

* Revert "log error too"

This reverts commit af0183e5d4ab458fdf44b88fbfab9908d090526f.

* Revert "temp debug script loading"

This reverts commit 3d687d541c76db2c5b55626c78ae448d3c25089c.

* Add comments explaining coverage disabling

* Fix ansi_up loading issue

* Merge latest from ads

* Use newer option

* Fix compile

* add debug logging warn

* Always log stack

* log more

* undo debug

* Update to use correct base path (+cleanup)

* distro

* fix compile errors

* Remove strict-vscode

* Fix sql editors not showing

* Show db dropdown input & fix styling

* Fix more info in gallery

* Fix gallery asset requests

* Delete unused workflow

* Fix tapable resolutions for smoke test compile error

* Fix smoke compile

* Disable crash reporting

* Disable interactive

Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
Charles Gagnon
2022-01-06 09:06:56 -08:00
committed by GitHub
parent fd2736b6a6
commit 2bc6a0cd01
2099 changed files with 79520 additions and 43813 deletions

View File

@@ -2,7 +2,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// @ts-check
@@ -37,7 +37,7 @@ const ALLOWED_CORS_ORIGINS = [
'http://127.0.0.1:8080',
];
const WEB_PLAYGROUND_VERSION = '0.0.10';
const WEB_PLAYGROUND_VERSION = '0.0.12';
const args = minimist(process.argv, {
boolean: [
@@ -53,7 +53,9 @@ const args = minimist(process.argv, {
'port',
'local_port',
'extension',
'github-auth'
'extensionId',
'github-auth',
'open-file'
],
});
@@ -69,6 +71,8 @@ if (args.help) {
' --local_port Local port override\n' +
' --secondary-port Secondary port\n' +
' --extension Path of an extension to include\n' +
' --extensionId Id of an extension to include\n' +
' --open-file uri of the file to open. Also support selections in the file. Eg: scheme://authority/path#L1:2-L10:3\n' +
' --github-auth Github authentication token\n' +
' --verbose Print out more information\n' +
' --help\n' +
@@ -169,23 +173,28 @@ async function getCommandlineProvidedExtensionInfos() {
const locations = {};
let extensionArg = args['extension'];
if (!extensionArg) {
let extensionIdArg = args['extensionId'];
if (!extensionArg && !extensionIdArg) {
return { extensions, locations };
}
const extensionPaths = Array.isArray(extensionArg) ? extensionArg : [extensionArg];
await Promise.all(extensionPaths.map(async extensionPath => {
extensionPath = path.resolve(process.cwd(), extensionPath);
const packageJSON = await getExtensionPackageJSON(extensionPath);
if (packageJSON) {
const extensionId = `${packageJSON.publisher}.${packageJSON.name}`;
extensions.push({
packageJSON,
extensionLocation: { scheme: SCHEME, authority: AUTHORITY, path: `/extension/${extensionId}` }
});
locations[extensionId] = extensionPath;
}
}));
if (extensionArg) {
const extensionPaths = Array.isArray(extensionArg) ? extensionArg : [extensionArg];
await Promise.all(extensionPaths.map(async extensionPath => {
extensionPath = path.resolve(process.cwd(), extensionPath);
const packageJSON = await getExtensionPackageJSON(extensionPath);
if (packageJSON) {
const extensionId = `${packageJSON.publisher}.${packageJSON.name}`;
extensions.push({ scheme: SCHEME, authority: AUTHORITY, path: `/extension/${extensionId}` });
locations[extensionId] = extensionPath;
}
}));
}
if (extensionIdArg) {
extensions.push(...(Array.isArray(extensionIdArg) ? extensionIdArg : [extensionIdArg]));
}
return { extensions, locations };
}
@@ -198,13 +207,6 @@ async function getExtensionPackageJSON(extensionPath) {
if (packageJSON.main && !packageJSON.browser) {
return; // unsupported
}
const packageNLSPath = path.join(extensionPath, 'package.nls.json');
const packageNLSExists = await exists(packageNLSPath);
if (packageNLSExists) {
packageJSON = extensions.translatePackageJSON(packageJSON, packageNLSPath); // temporary, until fixed in core
}
return packageJSON;
} catch (e) {
console.log(e);
@@ -397,7 +399,7 @@ async function handleRoot(req, res) {
}
const { extensions: builtInExtensions } = await builtInExtensionsPromise;
const { extensions: staticExtensions, locations: staticLocations } = await commandlineProvidedExtensionsPromise;
const { extensions: additionalBuiltinExtensions, locations: staticLocations } = await commandlineProvidedExtensionsPromise;
const dedupedBuiltInExtensions = [];
for (const builtInExtension of builtInExtensions) {
@@ -412,7 +414,7 @@ async function handleRoot(req, res) {
if (args.verbose) {
fancyLog(`${ansiColors.magenta('BuiltIn extensions')}: ${dedupedBuiltInExtensions.map(e => path.basename(e.extensionPath)).join(', ')}`);
fancyLog(`${ansiColors.magenta('Additional extensions')}: ${staticExtensions.map(e => path.basename(e.extensionLocation.path)).join(', ') || 'None'}`);
fancyLog(`${ansiColors.magenta('Additional extensions')}: ${additionalBuiltinExtensions.map(e => typeof e === 'string' ? e : path.basename(e.path)).join(', ') || 'None'}`);
}
const secondaryHost = (
@@ -420,10 +422,35 @@ async function handleRoot(req, res) {
? req.headers['host'].replace(':' + PORT, ':' + SECONDARY_PORT)
: `${HOST}:${SECONDARY_PORT}`
);
const openFileUrl = args['open-file'] ? url.parse(args['open-file'], true) : undefined;
let selection;
if (openFileUrl?.hash) {
const rangeMatch = /L(?<startLineNumber>\d+)(?::(?<startColumn>\d+))?((?:-L(?<endLineNumber>\d+))(?::(?<endColumn>\d+))?)?/.exec(openFileUrl.hash);
if (rangeMatch?.groups) {
const { startLineNumber, startColumn, endLineNumber, endColumn } = rangeMatch.groups;
const start = { line: parseInt(startLineNumber), column: startColumn ? (parseInt(startColumn) || 1) : 1 };
const end = endLineNumber ? { line: parseInt(endLineNumber), column: endColumn ? (parseInt(endColumn) || 1) : 1 } : start;
selection = { start, end }
}
}
const webConfigJSON = {
folderUri: folderUri,
staticExtensions,
webWorkerExtensionHostIframeSrc: `${SCHEME}://${secondaryHost}/static/out/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html`
additionalBuiltinExtensions,
webWorkerExtensionHostIframeSrc: `${SCHEME}://${secondaryHost}/static/out/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html`,
defaultLayout: openFileUrl ? {
force: true,
editors: [{
uri: {
scheme: openFileUrl.protocol.substring(0, openFileUrl.protocol.length - 1),
authority: openFileUrl.host,
path: openFileUrl.path,
},
selection,
}]
} : undefined,
settingsSyncOptions: args['enable-sync'] ? {
enabled: true
} : undefined
};
if (args['wrap-iframe']) {
webConfigJSON._wrapWebWorkerExtHostInIframe = true;