mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Merge vscode source through release 1.79.2 (#23482)
* log when an editor action doesn't run because of enablement * notebooks create/dispose editors. this means controllers must be created eagerly (😢) and that notebooks need a custom way of plugging comparision keys for session. works unless creating another session for the same cell of a duplicated editor * Set offSide to sql lang configuration to true (#183461) * Fixes #181764 (#183550) * fix typo * Always scroll down and focus the input (#183557) * Fixes #180386 (#183561) * cli: ensure ordering of rpc server messages (#183558) * cli: ensure ordering of rpc server messages Sending lots of messages to a stream would block them around the async tokio mutex, which is "fair" so doesn't preserve ordering. Instead, use the write_loop approach I introduced to the server_multiplexer for the same reason some time ago. * fix clippy * update for May endgame * testing: allow invalidateTestResults to take an array (#183569) * Document `ShareProvider` API proposal (#183568) * Document `ShareProvider` API proposal * Remove mention of VS Code from JSDoc * Add support for rendering svg and md in welcome message (#183580) * Remove toggle setting more eagerly (#183584) * rm message abt macOS * Change text (#183589) * Change text * Accidentally changed the wrong file * cli: improve output for code tunnel status (#183571) * testing: allow invalidateTestResults to take an array * cli: improve output for code tunnel status Fixes #183570 * [json/css/html] update services (#183595) * Add experimental setting to enable this dialog * Fix exporting chat model to JSON before it is initialized (#183597) * minimum scrolling to reveal the next cell on shift+enter (#183600) do minimum scrolling to reveal the next cell on Execute cell and select next * Fixing Jupyter notebook issue 13263 (#183527) fix for the issue, still need to understand why there is strange focusing * Tweak proposed API JSDoc (#183590) * Tweak proposed API JSDoc * workbench -> workspace * fix ? operator * Use active editor and show progress when sharing (#183603) Use active editor and show progress * use scroll setting variable correctly * Schedule welcome widget to show once between typing. (#183606) * Schedule dialog to show once between typing * Don't re-render if already displayed once * Add F10 keybinding for debugger step, even on Web. (#183510) Fixes #181792. Previously, for Web the keyboard shortcut was Alt-F10, because it was believed that F10 could not be bound on browsers. This turned out to be incorrect, so we make the shortcut consistent (F10) with desktop VSCode which is also what many other debuggers use. We keep Alt-F10 on web as a secondary keybinding to keep the experience some web users may have gotten used to by now. * Also pass process.env * Restore missing chat clear commands (#183651) * chore: update electron@22.5.4 (#183716) * Show remote indicator in web when remoteAuthority is set (#183728) * feat: .vuerc as json file (#153017) Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> * Delete --compatibility=1.63 code from the server (#183738) * Copy vscode.dev link to tunnel generates an invalid link when an untitled workspace is open (#183739) * Recent devcontainer display string corrupted on Get Started page (#183740) * Improve "next codeblock" navigation (#183744) * Improve "next codeblock" navigation Operate on the current focused response, or the last one, and scroll to the selected item * Normalize command title * Git - run git status if similarityThreshold changes (#183762) * fix aria-label issue in kb editor fixes A11y_GradeB_VSCode_Keyboard shortcut reads words together - Blind: Arrow key navigation to row Find the binding keys and "when" cell data are read together resulting in a word " CTRL + FeditorFocus instead of CTRL + F editorFocus" #182490 * Status - fix compact padding (#183768) * Remove angle brackets from VB brackets (#183782) Fixes #183359 * Update language config schema with more details about brackets. (#183779) * fix comment (#183812) * Support for `Notebook` CodeAction Kind (#183457) * nb kind support -- wip * allow notebook codeactions around single cell edit check * move notebook code action type out of editor --------- Co-authored-by: rebornix <penn.lv@gmail.com> * cli: fix connection default being applied (#183827) * cli: bump to openssl 1.1.1u (#183828) * Implement "delete" action for chat history (#183609) * Use desired file name when generating new md pasted file paths (#183861) Fixes #183851 * Default to filename for markdown new file if empty (#183864) Fixes #183848 * Fix small typo (#183865) Fixes #183819 * Noop when moving a symbol into the file it is already in (#183866) Fixes #183793 * Adjust codeAction validation to account for notebook kind (#183859) * Make JS/TS `go to configuration` commands work on non-`file:` file systems (#183688) Make `go to project` commands work on non-`file:` file systems Fixes #183685 * Can't do regex search after opening notebook (#183884) Fixes #183858 * Default to current dir for `move to file` select (#183875) Fixes #183870 `showOpenDialog` seems to ignore `defaultUri` if the file doesn't exist * Use `<...>` style markdown links when needed (#183876) Fixes #183849 * Remove check for context keys * Update xterm package * Enable updating a chat model without triggering incremental typing (#183894) * Enable chat "move" commands on empty sessions (#183895) * Enable chat "move" commands on empty sessions and also imported sessions * Fix command name * Fix some chat keybindings on windows (#183896) * "Revert File" on inactive editors are ignored (fix #177557) (#183903) * Empty reason while switching profile (fix #183775) (#183904) * fix https://github.com/microsoft/vscode-internalbacklog/issues/4278 (#183910) * fix https://github.com/microsoft/vscode/issues/183770 (#183914) * code --status displays a lot of errors before actual status output (fix #183787) (#183915) * joh/icy manatee (#183917) * Use idle value for widget of interactive editor controller https://github.com/microsoft/vscode/issues/183820 * also make preview editors idle values https://github.com/microsoft/vscode/issues/183820 * Fix #183777 (#183929) * Fix #182309 (#183925) * Tree checkbox item -> items (#183931) Fixes #183826 * Fixes #183909 (#183940) * Fix #183837 (#183943) fix #183837 * Git - fix #183941 (#183944) * Update xterm.css Fixes #181242 * chore: add @ulugbekna and @aiday-mar to my-endgame notebook (#183946) * Revert "When snippet mode is active, make `Tab` not accept suggestion but advance placeholder" This reverts commit 50a80cdb61511343996ff1d41d0b676c3d329f48. * revert not focusing completion list when quick suggest happens during snippet * change `snippetsPreventQuickSuggestions` default to false * Fix #181446 (#183956) * fix https://github.com/microsoft/vscode-internalbacklog/issues/4298 (#183957) * fix: remove extraneous incorrect context keys (#183959) These were actually getting added in getTestItemContextOverlay, and the test ID was using the extended ID which extensions do not know about. Fixes #183612 * Fixes https://github.com/microsoft/monaco-editor/issues/3920 (#183960) * fix https://github.com/microsoft/vscode-internalbacklog/issues/4324 (#183961) * fix #183030 * fix #180826 (#183962) * make message more generic for interactive editor help * . * fix #183968 * Keep codeblock toolbar visible when focused * Fix when clause on "Run in terminal" command * add important info to help menu * fix #183970 * Set `isRefactoring` for all TS refactoring edits (#183982) * consolidate * Disable move to file in TS versions < 5.2 (#183992) There are still a few key bugs with refactoring. We will ship this as a preview for TS 5.2+ instead of for 5.1 * Polish query accepting (#183995) We shouldn't send the same request to Copilot if the query hasn't changed. So if the query is the same, we short circut. Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4286 Also, when we open in chat, we should use the last accepted query, not what's in the input box. Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4280 * Allow widget to have focus (#184000) So that selecting non-code text works. Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4294 * Fix microsoft/vscode-internalbacklog#4257. Mitigate zindex for zone widgets. (#184001) * Change welcome dialog contribution to Eventually * Misc fixes * Workspace folder picker entry descriptions are suboptimal for some filesystems (fix #183418) (#184018) * cli - ignore std error unless verbose (#183787) (#184031) * joh/inquisitive meerkat (#184034) * only stash sessions that are none empty https://github.com/microsoft/vscode-internalbacklog/issues/4281 * only unstash a session once - unless new exchanges are made, https://github.com/microsoft/vscode-internalbacklog/issues/4281 * account for all exchange types * Improve declared components (#184039) * make sure to read setting (#184040) d'oh, related to https://github.com/microsoft/vscode/issues/173387#issuecomment-1571696644 * [html] update service (#184049) [html] update service. FIxes #181176 * reset context keys on reset/hide (#184042) fixes https://github.com/microsoft/vscode-internalbacklog/issues/4330 * use `Lazy`, not `IdleValue` for the IE widget held by the eager controller (#184048) https://github.com/microsoft/vscode/issues/183820 * fix https://github.com/microsoft/vscode-internalbacklog/issues/4333 (#184067) * use undo-loop instead of undo-edit when discarding chat session (#184063) * use undo-loop instead of undo-edit when discarding chat session fixes https://github.com/microsoft/vscode-internalbacklog/issues/4118 * fix tests, wait for correct state * Add logging to node download (#184070) Add logging to node download. For #182951 * re-enable default zone widget revealing when showing (#184072) fixes https://github.com/microsoft/vscode-internalbacklog/issues/4332, also fixes https://github.com/microsoft/vscode-internalbacklog/issues/3784 * fix #178202 * Allow APIs in stable (#184062) * Fix microsoft/vscode-internalbacklog#4206. Override List view whitespace css for monaco editor (#184087) * Fix JSDoc grammatical error (#184090) * Pick up TS 5.1.3 (#184091) Fixes #182931 * Misc fixes * update distro (#184097) * chore: update electron@22.5.5 (#184116) * Extension host veto is registered multiple times on restart (fix #183778) (#184127) Extension host veto is registered multiple times on restart (#183778) * Do not auto start the local web worker extension host (#184137) * Allow embedders to intercept trustedTypes.createPolicy calls (#184136) Allow embedders to intercept trustedTypes.createPolicy calls (#184100) * fix: reading from console output for --status on windows and linux (#184138) fix: reading from console output for --status on windows and linux (#184118) * Misc fixes * code --status displays a lot of errors before actual status output (fix #183787) (#184200) fix 183787 * (cherry-pick to 1.79 from main) Handle galleryExtension failure in featuredExtensionService (#184205) Handle galleryExtension failure in featuredExtensionService (#184198) Handle galleryExtension failure * Fix #184183. Multiple output height updates are skipped. (#184188) * Post merge init fixes * Misc build issues * disable toggle inline diff of `alt` down https://github.com/microsoft/vscode-internalbacklog/issues/4342 * Take into account already activated extensions when computing running locations (#184303) Take into account already activated extensions when computing running locations (fixes #184180) * Avoid `extensionService.getExtension` and use `ActivationKind.Immediate` to allow that URI handling works while resolving (#184310) Avoid `extensionService.getExtension` and use `ActivationKind.Immediate` to allow that URI handling works while resolving (fixes #182217) * WIP * rm fish auto injection * More breaks * Fix Port Attributes constructor (#184412) * WIP * WIP * Allow extensions to get at the exports of other extensions during resolving (#184487) Allow extensions to get at the exports of other extensions during resolving (fixes #184472) * do not auto finish session when inline chat widgets have focus re https://github.com/microsoft/vscode-internalbacklog/issues/4354 * fix compile errors caused by new base method * WIP * WIP * WIP * WIP * Build errors * unc - fix path traversal bypass * Bump version * cherry-pick prod changes from main * Disable sandbox * Build break from merge * bump version * Merge pull request #184739 from max06/max06/issue184659 Restore ShellIntegration for fish (#184659) * Git - only add --find-renames if the value is not the default one (#185053) Git - only add --find-renames if the value is not the default one (#184992) * Cherry-pick: Revert changes to render featured extensions when available (#184747) Revert changes to render featured extensions when available. (#184573) * Lower timeouts for experimentation and gallery service * Revert changes to render extensions when available * Add audio cues * fix: disable app sandbox when --no-sandbox is present (#184913) * fix: disable app sandbox when --no-sandbox is present (#184897) * fix: loading minimist in packaged builds * Runtime errors * UNC allow list checks cannot be disabled in extension host (fix #184989) (#185085) * UNC allow list checks cannot be disabled in extension host (#184989) * Update src/vs/base/node/unc.js Co-authored-by: Robo <hop2deep@gmail.com> --------- Co-authored-by: Robo <hop2deep@gmail.com> * Add notebook extension * Fix mangling issues * Fix mangling issues * npm install * npm install * Issues blocking bundle * Fix build folder compile errors * Fix windows bundle build * Linting fixes * Fix sqllint issues * Update yarn.lock files * Fix unit tests * Fix a couple breaks from test fixes * Bump distro * redo the checkbox style * Update linux build container dockerfile * Bump build image tag * Bump native watch dog package * Bump node-pty * Bump distro * Fix documnetation error * Update distro * redo the button styles * Update datasource TS * Add missing yarn.lock files * Windows setup fix * Turn off extension unit tests while investigating * color box style * Remove appx * Turn off test log upload * update dropdownlist style * fix universal app build error (#23488) * Skip flaky bufferContext vscode test --------- Co-authored-by: Johannes <johannes.rieken@gmail.com> Co-authored-by: Henning Dieterichs <hdieterichs@microsoft.com> Co-authored-by: Julien Richard <jairbubbles@hotmail.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Megan Rogge <merogge@microsoft.com> Co-authored-by: meganrogge <megan.rogge@microsoft.com> Co-authored-by: Rob Lourens <roblourens@gmail.com> Co-authored-by: Connor Peet <connor@peet.io> Co-authored-by: Joyce Er <joyce.er@microsoft.com> Co-authored-by: Bhavya U <bhavyau@microsoft.com> Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> Co-authored-by: Aaron Munger <aamunger@microsoft.com> Co-authored-by: Aiday Marlen Kyzy <amarlenkyzy@microsoft.com> Co-authored-by: rebornix <penn.lv@gmail.com> Co-authored-by: Ole <oler@google.com> Co-authored-by: Jean Pierre <jeanp413@hotmail.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Yash Singh <saiansh2525@gmail.com> Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Co-authored-by: Ulugbek Abdullaev <ulugbekna@gmail.com> Co-authored-by: Alex Ross <alros@microsoft.com> Co-authored-by: Michael Lively <milively@microsoft.com> Co-authored-by: Matt Bierner <matb@microsoft.com> Co-authored-by: Andrea Mah <31675041+andreamah@users.noreply.github.com> Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com> Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com> Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Co-authored-by: Tyler James Leonhardt <me@tylerleonhardt.com> Co-authored-by: Alexandru Dima <alexdima@microsoft.com> Co-authored-by: Joao Moreno <Joao.Moreno@microsoft.com> Co-authored-by: Alan Ren <alanren@microsoft.com>
This commit is contained in:
91
scripts/code-perf.js
Normal file
91
scripts/code-perf.js
Normal file
@@ -0,0 +1,91 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
const path = require('path');
|
||||
const perf = require('@vscode/vscode-perf');
|
||||
|
||||
const VSCODE_FOLDER = path.join(__dirname, '..');
|
||||
|
||||
async function main() {
|
||||
|
||||
const args = process.argv;
|
||||
/** @type {string | undefined} */
|
||||
let build = undefined;
|
||||
|
||||
if (args.indexOf('--help') === -1 && args.indexOf('-h') === -1) {
|
||||
// get build arg from args
|
||||
let buildArgIndex = args.indexOf('--build');
|
||||
buildArgIndex = buildArgIndex === -1 ? args.indexOf('-b') : buildArgIndex;
|
||||
if (buildArgIndex === -1) {
|
||||
let runtimeArgIndex = args.indexOf('--runtime');
|
||||
runtimeArgIndex = runtimeArgIndex === -1 ? args.indexOf('-r') : runtimeArgIndex;
|
||||
if (runtimeArgIndex !== -1 && args[runtimeArgIndex + 1] !== 'desktop') {
|
||||
console.error('Please provide the --build argument. It is an executable file for desktop or a URL for web');
|
||||
process.exit(1);
|
||||
}
|
||||
build = getLocalCLIPath();
|
||||
} else {
|
||||
build = args[buildArgIndex + 1];
|
||||
if (build !== 'insider' && build !== 'stable' && build !== 'exploration') {
|
||||
build = getExePath(args[buildArgIndex + 1]);
|
||||
}
|
||||
args.splice(buildArgIndex + 1, 1);
|
||||
}
|
||||
|
||||
args.push('--folder');
|
||||
args.push(VSCODE_FOLDER);
|
||||
args.push('--file');
|
||||
args.push(path.join(VSCODE_FOLDER, 'package.json'));
|
||||
}
|
||||
|
||||
if (build) {
|
||||
args.push('--build');
|
||||
args.push(build);
|
||||
}
|
||||
|
||||
await perf.run();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} buildPath
|
||||
* @returns {string}
|
||||
*/
|
||||
function getExePath(buildPath) {
|
||||
buildPath = path.normalize(path.resolve(buildPath));
|
||||
if (buildPath === path.normalize(getLocalCLIPath())) {
|
||||
return buildPath;
|
||||
}
|
||||
let relativeExePath;
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
relativeExePath = path.join('Contents', 'MacOS', 'Electron');
|
||||
break;
|
||||
case 'linux': {
|
||||
const product = require(path.join(buildPath, 'resources', 'app', 'product.json'));
|
||||
relativeExePath = product.applicationName;
|
||||
break;
|
||||
}
|
||||
case 'win32': {
|
||||
const product = require(path.join(buildPath, 'resources', 'app', 'product.json'));
|
||||
relativeExePath = `${product.nameShort}.exe`;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new Error('Unsupported platform.');
|
||||
}
|
||||
return buildPath.endsWith(relativeExePath) ? buildPath : path.join(buildPath, relativeExePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
function getLocalCLIPath() {
|
||||
return process.platform === 'win32' ? path.join(VSCODE_FOLDER, 'scripts', 'code.bat') : path.join(VSCODE_FOLDER, 'scripts', 'code.sh');
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -14,9 +14,8 @@ const cp = require('child_process');
|
||||
const minimist = require('minimist');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
const remote = require('gulp-remote-retry-src');
|
||||
const vfs = require('vinyl-fs');
|
||||
const opn = require('opn');
|
||||
const https = require('https');
|
||||
|
||||
const APP_ROOT = path.join(__dirname, '..');
|
||||
const WEB_DEV_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInWebDevExtensions');
|
||||
@@ -41,8 +40,10 @@ async function main() {
|
||||
|
||||
if (args.help) {
|
||||
console.log(
|
||||
'./scripts/code-web.sh|bat [options]\n' +
|
||||
' --playground Include the vscode-web-playground extension (added by default if no folderPath is provided)\n'
|
||||
'./scripts/code-web.sh|bat[, folderMountPath[, options]]\n' +
|
||||
' Start with an empty workspace and no folder opened in explorer\n' +
|
||||
' folderMountPath Open local folder (eg: use `.` to open current directory)\n' +
|
||||
' --playground Include the vscode-web-playground extension\n'
|
||||
);
|
||||
startServer(['--help']);
|
||||
return;
|
||||
@@ -59,7 +60,9 @@ async function main() {
|
||||
if (args['port'] === undefined) {
|
||||
serverArgs.push('--port', PORT);
|
||||
}
|
||||
if (args['playground'] === true || (args['_'].length === 0 && !args['--folder-uri'])) {
|
||||
|
||||
// only use `./scripts/code-web.sh --playground` to add vscode-web-playground extension by default.
|
||||
if (args['playground'] === true) {
|
||||
serverArgs.push('--extensionPath', WEB_DEV_EXTENSIONS_ROOT);
|
||||
serverArgs.push('--folder-uri', 'memfs:///sample-folder');
|
||||
await ensureWebDevExtensions(args['verbose']);
|
||||
@@ -75,7 +78,6 @@ async function main() {
|
||||
|
||||
serverArgs.push(...process.argv.slice(2).filter(v => !v.startsWith('--playground') && v !== '--no-playground'));
|
||||
|
||||
|
||||
startServer(serverArgs);
|
||||
if (openSystemBrowser) {
|
||||
opn(`http://${HOST}:${PORT}/`);
|
||||
@@ -109,6 +111,23 @@ async function directoryExists(path) {
|
||||
}
|
||||
}
|
||||
|
||||
/** @return {Promise<void>} */
|
||||
async function downloadPlaygroundFile(fileName, httpsLocation, destinationRoot) {
|
||||
const destination = path.join(destinationRoot, fileName);
|
||||
await fs.promises.mkdir(path.dirname(destination), { recursive: true });
|
||||
const fileStream = fs.createWriteStream(destination);
|
||||
return (new Promise((resolve, reject) => {
|
||||
const request = https.get(path.posix.join(httpsLocation, fileName), response => {
|
||||
response.pipe(fileStream);
|
||||
fileStream.on('finish', () => {
|
||||
fileStream.close();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
request.on('error', reject);
|
||||
}));
|
||||
}
|
||||
|
||||
async function ensureWebDevExtensions(verbose) {
|
||||
|
||||
// Playground (https://github.com/microsoft/vscode-web-playground)
|
||||
@@ -133,11 +152,11 @@ async function ensureWebDevExtensions(verbose) {
|
||||
if (verbose) {
|
||||
fancyLog(`${ansiColors.magenta('Web Development extensions')}: Downloading vscode-web-playground to ${webDevPlaygroundRoot}`);
|
||||
}
|
||||
await new Promise((resolve, reject) => {
|
||||
remote(['package.json', 'dist/extension.js', 'dist/extension.js.map'], {
|
||||
base: 'https://raw.githubusercontent.com/microsoft/vscode-web-playground/main/'
|
||||
}).pipe(vfs.dest(webDevPlaygroundRoot)).on('end', resolve).on('error', reject);
|
||||
});
|
||||
const playgroundRepo = `https://raw.githubusercontent.com/microsoft/vscode-web-playground/main/`;
|
||||
await Promise.all(['package.json', 'dist/extension.js', 'dist/extension.js.map'].map(
|
||||
fileName => downloadPlaygroundFile(fileName, playgroundRepo, webDevPlaygroundRoot)
|
||||
));
|
||||
|
||||
} else {
|
||||
if (verbose) {
|
||||
fancyLog(`${ansiColors.magenta('Web Development extensions')}: Using existing vscode-web-playground in ${webDevPlaygroundRoot}`);
|
||||
@@ -145,5 +164,4 @@ async function ensureWebDevExtensions(verbose) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
main();
|
||||
|
||||
@@ -75,6 +75,12 @@ if [ "$IN_WSL" == "true" ] && [ -z "$DISPLAY" ]; then
|
||||
code-wsl "$@"
|
||||
elif [ -f /mnt/wslg/versions.txt ]; then
|
||||
code --disable-gpu "$@"
|
||||
elif [ -f /.dockerenv ]; then
|
||||
# Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=1263267
|
||||
# Chromium does not release shared memory when streaming scripts
|
||||
# which might exhaust the available resources in the container environment
|
||||
# leading to failed script loading.
|
||||
code --disable-dev-shm-usage "$@"
|
||||
else
|
||||
code "$@"
|
||||
fi
|
||||
|
||||
710
scripts/playground-server.ts
Normal file
710
scripts/playground-server.ts
Normal file
@@ -0,0 +1,710 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as fsPromise from 'fs/promises';
|
||||
import path from 'path';
|
||||
import * as http from 'http';
|
||||
import * as parcelWatcher from '@parcel/watcher';
|
||||
|
||||
/**
|
||||
* Launches the server for the monaco editor playground
|
||||
*/
|
||||
function main() {
|
||||
const server = new HttpServer({ host: 'localhost', port: 5001, cors: true });
|
||||
server.use('/', redirectToMonacoEditorPlayground());
|
||||
|
||||
const rootDir = path.join(__dirname, '..');
|
||||
const fileServer = new FileServer(rootDir);
|
||||
server.use(fileServer.handleRequest);
|
||||
|
||||
const moduleIdMapper = new SimpleModuleIdPathMapper(path.join(rootDir, 'out'));
|
||||
const editorMainBundle = new CachedBundle('vs/editor/editor.main', moduleIdMapper);
|
||||
fileServer.overrideFileContent(editorMainBundle.entryModulePath, () => editorMainBundle.bundle());
|
||||
|
||||
const hotReloadJsCode = getHotReloadCode(new URL('/file-changes', server.url));
|
||||
const loaderPath = path.join(rootDir, 'out/vs/loader.js');
|
||||
fileServer.overrideFileContent(loaderPath, async () =>
|
||||
Buffer.from(new TextEncoder().encode(`${await fsPromise.readFile(loaderPath, 'utf8')}\n${hotReloadJsCode}`))
|
||||
);
|
||||
|
||||
const watcher = DirWatcher.watchRecursively(moduleIdMapper.rootDir);
|
||||
watcher.onDidChange((path, newContent) => {
|
||||
editorMainBundle.setModuleContent(path, newContent);
|
||||
editorMainBundle.bundle();
|
||||
console.log(`${new Date().toLocaleTimeString()}, file change: ${path}`);
|
||||
});
|
||||
server.use('/file-changes', handleGetFileChangesRequest(watcher, fileServer));
|
||||
|
||||
console.log(`Server listening on ${server.url}`);
|
||||
}
|
||||
setTimeout(main, 0);
|
||||
|
||||
// #region Http/File Server
|
||||
|
||||
type RequestHandler = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<void>;
|
||||
type ChainableRequestHandler = (req: http.IncomingMessage, res: http.ServerResponse, next: RequestHandler) => Promise<void>;
|
||||
|
||||
class HttpServer {
|
||||
private readonly server: http.Server;
|
||||
public readonly url: URL;
|
||||
|
||||
private handler: ChainableRequestHandler[] = [];
|
||||
|
||||
constructor(options: { host: string; port: number; cors: boolean }) {
|
||||
this.server = http.createServer(async (req, res) => {
|
||||
if (options.cors) {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
|
||||
let i = 0;
|
||||
const next = async (req: http.IncomingMessage, res: http.ServerResponse) => {
|
||||
if (i >= this.handler.length) {
|
||||
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
||||
res.end('404 Not Found');
|
||||
return;
|
||||
}
|
||||
const handler = this.handler[i];
|
||||
i++;
|
||||
await handler(req, res, next);
|
||||
};
|
||||
await next(req, res);
|
||||
});
|
||||
this.server.listen(options.port, options.host);
|
||||
this.url = new URL(`http://${options.host}:${options.port}`);
|
||||
}
|
||||
|
||||
use(handler: ChainableRequestHandler);
|
||||
use(path: string, handler: ChainableRequestHandler);
|
||||
use(...args: [path: string, handler: ChainableRequestHandler] | [handler: ChainableRequestHandler]) {
|
||||
const handler = args.length === 1 ? args[0] : (req, res, next) => {
|
||||
const path = args[0];
|
||||
const requestedUrl = new URL(req.url, this.url);
|
||||
if (requestedUrl.pathname === path) {
|
||||
return args[1](req, res, next);
|
||||
} else {
|
||||
return next(req, res);
|
||||
}
|
||||
};
|
||||
|
||||
this.handler.push(handler);
|
||||
}
|
||||
}
|
||||
|
||||
function redirectToMonacoEditorPlayground(): ChainableRequestHandler {
|
||||
return async (req, res) => {
|
||||
const url = new URL('https://microsoft.github.io/monaco-editor/playground.html');
|
||||
url.searchParams.append('source', `http://${req.headers.host}/out/vs`);
|
||||
res.writeHead(302, { Location: url.toString() });
|
||||
res.end();
|
||||
};
|
||||
}
|
||||
|
||||
class FileServer {
|
||||
private readonly overrides = new Map<string, () => Promise<Buffer>>();
|
||||
|
||||
constructor(public readonly publicDir: string) { }
|
||||
|
||||
public readonly handleRequest: ChainableRequestHandler = async (req, res, next) => {
|
||||
const requestedUrl = new URL(req.url!, `http://${req.headers.host}`);
|
||||
|
||||
const pathName = requestedUrl.pathname;
|
||||
|
||||
const filePath = path.join(this.publicDir, pathName);
|
||||
if (!filePath.startsWith(this.publicDir)) {
|
||||
res.writeHead(403, { 'Content-Type': 'text/plain' });
|
||||
res.end('403 Forbidden');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const override = this.overrides.get(filePath);
|
||||
let content: Buffer;
|
||||
if (override) {
|
||||
content = await override();
|
||||
} else {
|
||||
content = await fsPromise.readFile(filePath);
|
||||
}
|
||||
|
||||
const contentType = getContentType(filePath);
|
||||
res.writeHead(200, { 'Content-Type': contentType });
|
||||
res.end(content);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
next(req, res);
|
||||
} else {
|
||||
res.writeHead(500, { 'Content-Type': 'text/plain' });
|
||||
res.end('500 Internal Server Error');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public filePathToUrlPath(filePath: string): string | undefined {
|
||||
const relative = path.relative(this.publicDir, filePath);
|
||||
const isSubPath = !!relative && !relative.startsWith('..') && !path.isAbsolute(relative);
|
||||
|
||||
if (!isSubPath) {
|
||||
return undefined;
|
||||
}
|
||||
const relativePath = relative.replace(/\\/g, '/');
|
||||
return `/${relativePath}`;
|
||||
}
|
||||
|
||||
public overrideFileContent(filePath: string, content: () => Promise<Buffer>): void {
|
||||
this.overrides.set(filePath, content);
|
||||
}
|
||||
}
|
||||
|
||||
function getContentType(filePath: string): string {
|
||||
const extname = path.extname(filePath);
|
||||
switch (extname) {
|
||||
case '.js':
|
||||
return 'text/javascript';
|
||||
case '.css':
|
||||
return 'text/css';
|
||||
case '.json':
|
||||
return 'application/json';
|
||||
case '.png':
|
||||
return 'image/png';
|
||||
case '.jpg':
|
||||
return 'image/jpg';
|
||||
default:
|
||||
return 'text/plain';
|
||||
}
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region File Watching
|
||||
|
||||
interface IDisposable {
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
class DirWatcher {
|
||||
public static watchRecursively(dir: string): DirWatcher {
|
||||
const listeners: ((path: string, newContent: string) => void)[] = [];
|
||||
const fileContents = new Map<string, string>();
|
||||
const event = (handler: (path: string, newContent: string) => void) => {
|
||||
listeners.push(handler);
|
||||
return {
|
||||
dispose: () => {
|
||||
const idx = listeners.indexOf(handler);
|
||||
if (idx >= 0) {
|
||||
listeners.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
parcelWatcher.subscribe(dir, async (err, events) => {
|
||||
for (const e of events) {
|
||||
if (e.type === 'update') {
|
||||
const newContent = await fsPromise.readFile(e.path, 'utf8');
|
||||
if (fileContents.get(e.path) !== newContent) {
|
||||
fileContents.set(e.path, newContent);
|
||||
listeners.forEach(l => l(e.path, newContent));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return new DirWatcher(event);
|
||||
}
|
||||
|
||||
constructor(public readonly onDidChange: (handler: (path: string, newContent: string) => void) => IDisposable) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleGetFileChangesRequest(watcher: DirWatcher, fileServer: FileServer): ChainableRequestHandler {
|
||||
return async (req, res) => {
|
||||
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||
const d = watcher.onDidChange(fsPath => {
|
||||
const path = fileServer.filePathToUrlPath(fsPath);
|
||||
if (path) {
|
||||
res.write(JSON.stringify({ changedPath: path }) + '\n');
|
||||
}
|
||||
});
|
||||
res.on('close', () => d.dispose());
|
||||
};
|
||||
}
|
||||
|
||||
function getHotReloadCode(fileChangesUrl: URL): string {
|
||||
const additionalJsCode = `
|
||||
function $watchChanges() {
|
||||
console.log("Connecting to server to watch for changes...");
|
||||
fetch(${JSON.stringify(fileChangesUrl)})
|
||||
.then(async request => {
|
||||
const reader = request.body.getReader();
|
||||
let buffer = '';
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) { break; }
|
||||
buffer += new TextDecoder().decode(value);
|
||||
const lines = buffer.split('\\n');
|
||||
buffer = lines.pop();
|
||||
for (const line of lines) {
|
||||
const data = JSON.parse(line);
|
||||
if (data.changedPath.endsWith('.css')) {
|
||||
console.log('css changed', data.changedPath);
|
||||
const styleSheet = [...document.querySelectorAll("link[rel='stylesheet']")].find(l => new URL(l.href, document.location.href).pathname.endsWith(data.changedPath));
|
||||
if (styleSheet) {
|
||||
styleSheet.href = styleSheet.href.replace(/\\?.*/, '') + '?' + Date.now();
|
||||
}
|
||||
} else {
|
||||
$sendMessageToParent({ kind: "reload" });
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setTimeout($watchChanges, 1000);
|
||||
});
|
||||
|
||||
}
|
||||
$watchChanges();
|
||||
`;
|
||||
return additionalJsCode;
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Bundling
|
||||
|
||||
class CachedBundle {
|
||||
public readonly entryModulePath = this.mapper.resolveRequestToPath(this.moduleId)!;
|
||||
|
||||
constructor(
|
||||
private readonly moduleId: string,
|
||||
private readonly mapper: SimpleModuleIdPathMapper,
|
||||
) {
|
||||
}
|
||||
|
||||
private loader: ModuleLoader | undefined = undefined;
|
||||
|
||||
private bundlePromise: Promise<Buffer> | undefined = undefined;
|
||||
public async bundle(): Promise<Buffer> {
|
||||
if (!this.bundlePromise) {
|
||||
this.bundlePromise = (async () => {
|
||||
if (!this.loader) {
|
||||
this.loader = new ModuleLoader(this.mapper);
|
||||
await this.loader.addModuleAndDependencies(this.entryModulePath);
|
||||
}
|
||||
const editorEntryPoint = await this.loader.getModule(this.entryModulePath);
|
||||
const content = bundleWithDependencies(editorEntryPoint!);
|
||||
return content;
|
||||
})();
|
||||
}
|
||||
return this.bundlePromise;
|
||||
}
|
||||
|
||||
public async setModuleContent(path: string, newContent: string): Promise<void> {
|
||||
if (!this.loader) {
|
||||
return;
|
||||
}
|
||||
const module = await this.loader!.getModule(path);
|
||||
if (module) {
|
||||
if (!this.loader.updateContent(module, newContent)) {
|
||||
this.loader = undefined;
|
||||
}
|
||||
}
|
||||
this.bundlePromise = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function bundleWithDependencies(module: IModule): Buffer {
|
||||
const visited = new Set<IModule>();
|
||||
const builder = new SourceMapBuilder();
|
||||
|
||||
function visit(module: IModule) {
|
||||
if (visited.has(module)) {
|
||||
return;
|
||||
}
|
||||
visited.add(module);
|
||||
for (const dep of module.dependencies) {
|
||||
visit(dep);
|
||||
}
|
||||
builder.addSource(module.source);
|
||||
}
|
||||
|
||||
visit(module);
|
||||
|
||||
const sourceMap = builder.toSourceMap();
|
||||
sourceMap.sourceRoot = module.source.sourceMap.sourceRoot;
|
||||
const sourceMapBase64Str = Buffer.from(JSON.stringify(sourceMap)).toString('base64');
|
||||
|
||||
builder.addLine(`//# sourceMappingURL=data:application/json;base64,${sourceMapBase64Str}`);
|
||||
|
||||
return builder.toContent();
|
||||
}
|
||||
|
||||
class ModuleLoader {
|
||||
private readonly modules = new Map<string, Promise<IModule | undefined>>();
|
||||
|
||||
constructor(private readonly mapper: SimpleModuleIdPathMapper) { }
|
||||
|
||||
public getModule(path: string): Promise<IModule | undefined> {
|
||||
return Promise.resolve(this.modules.get(path));
|
||||
}
|
||||
|
||||
public updateContent(module: IModule, newContent: string): boolean {
|
||||
const parsedModule = parseModule(newContent, module.path, this.mapper);
|
||||
if (!parsedModule) {
|
||||
return false;
|
||||
}
|
||||
if (!arrayEquals(parsedModule.dependencyRequests, module.dependencyRequests)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
module.dependencyRequests = parsedModule.dependencyRequests;
|
||||
module.source = parsedModule.source;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async addModuleAndDependencies(path: string): Promise<IModule | undefined> {
|
||||
if (this.modules.has(path)) {
|
||||
return this.modules.get(path)!;
|
||||
}
|
||||
|
||||
const promise = (async () => {
|
||||
const content = await fsPromise.readFile(path, { encoding: 'utf-8' });
|
||||
|
||||
const parsedModule = parseModule(content, path, this.mapper);
|
||||
if (!parsedModule) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const dependencies = (await Promise.all(parsedModule.dependencyRequests.map(async r => {
|
||||
if (r === 'require' || r === 'exports' || r === 'module') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const depPath = this.mapper.resolveRequestToPath(r, path);
|
||||
if (!depPath) {
|
||||
return null;
|
||||
}
|
||||
return await this.addModuleAndDependencies(depPath);
|
||||
}))).filter((d): d is IModule => !!d);
|
||||
|
||||
const module: IModule = {
|
||||
id: this.mapper.getModuleId(path)!,
|
||||
dependencyRequests: parsedModule.dependencyRequests,
|
||||
dependencies,
|
||||
path,
|
||||
source: parsedModule.source,
|
||||
};
|
||||
return module;
|
||||
})();
|
||||
|
||||
this.modules.set(path, promise);
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
|
||||
function arrayEquals<T>(a: T[], b: T[]): boolean {
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
function parseModule(content: string, path: string, mapper: SimpleModuleIdPathMapper): { source: Source; dependencyRequests: string[] } | undefined {
|
||||
const m = content.match(/define\((\[.*?\])/);
|
||||
if (!m) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const dependencyRequests = JSON.parse(m[1].replace(/'/g, '"')) as string[];
|
||||
|
||||
const sourceMapHeader = '//# sourceMappingURL=data:application/json;base64,';
|
||||
const idx = content.indexOf(sourceMapHeader);
|
||||
|
||||
let sourceMap: any = null;
|
||||
if (idx !== -1) {
|
||||
const sourceMapJsonStr = Buffer.from(content.substring(idx + sourceMapHeader.length), 'base64').toString('utf-8');
|
||||
sourceMap = JSON.parse(sourceMapJsonStr);
|
||||
content = content.substring(0, idx);
|
||||
}
|
||||
|
||||
content = content.replace('define([', `define("${mapper.getModuleId(path)}", [`);
|
||||
|
||||
const contentBuffer = Buffer.from(encoder.encode(content));
|
||||
const source = new Source(contentBuffer, sourceMap);
|
||||
|
||||
return { dependencyRequests, source };
|
||||
}
|
||||
|
||||
class SimpleModuleIdPathMapper {
|
||||
constructor(public readonly rootDir: string) { }
|
||||
|
||||
public getModuleId(path: string): string | null {
|
||||
if (!path.startsWith(this.rootDir) || !path.endsWith('.js')) {
|
||||
return null;
|
||||
}
|
||||
const moduleId = path.substring(this.rootDir.length + 1);
|
||||
|
||||
|
||||
return moduleId.replace(/\\/g, '/').substring(0, moduleId.length - 3);
|
||||
}
|
||||
|
||||
public resolveRequestToPath(request: string, requestingModulePath?: string): string | null {
|
||||
if (request.indexOf('css!') !== -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (request.startsWith('.')) {
|
||||
return path.join(path.dirname(requestingModulePath!), request + '.js');
|
||||
} else {
|
||||
return path.join(this.rootDir, request + '.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface IModule {
|
||||
id: string;
|
||||
dependencyRequests: string[];
|
||||
dependencies: IModule[];
|
||||
path: string;
|
||||
source: Source;
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region SourceMapBuilder
|
||||
|
||||
// From https://stackoverflow.com/questions/29905373/how-to-create-sourcemaps-for-concatenated-files with modifications
|
||||
|
||||
class Source {
|
||||
// Ends with \n
|
||||
public readonly content: Buffer;
|
||||
public readonly sourceMap: SourceMap;
|
||||
public readonly sourceLines: number;
|
||||
|
||||
public readonly sourceMapMappings: Buffer;
|
||||
|
||||
|
||||
constructor(content: Buffer, sourceMap: SourceMap | undefined) {
|
||||
if (!sourceMap) {
|
||||
sourceMap = SourceMapBuilder.emptySourceMap;
|
||||
}
|
||||
|
||||
let sourceLines = countNL(content);
|
||||
if (content.length > 0 && content[content.length - 1] !== 10) {
|
||||
sourceLines++;
|
||||
content = Buffer.concat([content, Buffer.from([10])]);
|
||||
}
|
||||
|
||||
this.content = content;
|
||||
this.sourceMap = sourceMap;
|
||||
this.sourceLines = sourceLines;
|
||||
this.sourceMapMappings = typeof this.sourceMap.mappings === 'string'
|
||||
? Buffer.from(encoder.encode(sourceMap.mappings as string))
|
||||
: this.sourceMap.mappings;
|
||||
}
|
||||
}
|
||||
|
||||
class SourceMapBuilder {
|
||||
public static emptySourceMap: SourceMap = { version: 3, sources: [], mappings: Buffer.alloc(0) };
|
||||
|
||||
private readonly outputBuffer = new DynamicBuffer();
|
||||
private readonly sources: string[] = [];
|
||||
private readonly mappings = new DynamicBuffer();
|
||||
private lastSourceIndex = 0;
|
||||
private lastSourceLine = 0;
|
||||
private lastSourceCol = 0;
|
||||
|
||||
addLine(text: string) {
|
||||
this.outputBuffer.addString(text);
|
||||
this.outputBuffer.addByte(10);
|
||||
this.mappings.addByte(59); // ;
|
||||
}
|
||||
|
||||
addSource(source: Source) {
|
||||
const sourceMap = source.sourceMap;
|
||||
this.outputBuffer.addBuffer(source.content);
|
||||
|
||||
const sourceRemap: number[] = [];
|
||||
for (const v of sourceMap.sources) {
|
||||
let pos = this.sources.indexOf(v);
|
||||
if (pos < 0) {
|
||||
pos = this.sources.length;
|
||||
this.sources.push(v);
|
||||
}
|
||||
sourceRemap.push(pos);
|
||||
}
|
||||
let lastOutputCol = 0;
|
||||
|
||||
const inputMappings = source.sourceMapMappings;
|
||||
let outputLine = 0;
|
||||
let ip = 0;
|
||||
let inOutputCol = 0;
|
||||
let inSourceIndex = 0;
|
||||
let inSourceLine = 0;
|
||||
let inSourceCol = 0;
|
||||
let shift = 0;
|
||||
let value = 0;
|
||||
let valpos = 0;
|
||||
const commit = () => {
|
||||
if (valpos === 0) { return; }
|
||||
this.mappings.addVLQ(inOutputCol - lastOutputCol);
|
||||
lastOutputCol = inOutputCol;
|
||||
if (valpos === 1) {
|
||||
valpos = 0;
|
||||
return;
|
||||
}
|
||||
const outSourceIndex = sourceRemap[inSourceIndex];
|
||||
this.mappings.addVLQ(outSourceIndex - this.lastSourceIndex);
|
||||
this.lastSourceIndex = outSourceIndex;
|
||||
this.mappings.addVLQ(inSourceLine - this.lastSourceLine);
|
||||
this.lastSourceLine = inSourceLine;
|
||||
this.mappings.addVLQ(inSourceCol - this.lastSourceCol);
|
||||
this.lastSourceCol = inSourceCol;
|
||||
valpos = 0;
|
||||
};
|
||||
while (ip < inputMappings.length) {
|
||||
let b = inputMappings[ip++];
|
||||
if (b === 59) { // ;
|
||||
commit();
|
||||
this.mappings.addByte(59);
|
||||
inOutputCol = 0;
|
||||
lastOutputCol = 0;
|
||||
outputLine++;
|
||||
} else if (b === 44) { // ,
|
||||
commit();
|
||||
this.mappings.addByte(44);
|
||||
} else {
|
||||
b = charToInteger[b];
|
||||
if (b === 255) { throw new Error('Invalid sourceMap'); }
|
||||
value += (b & 31) << shift;
|
||||
if (b & 32) {
|
||||
shift += 5;
|
||||
} else {
|
||||
const shouldNegate = value & 1;
|
||||
value >>= 1;
|
||||
if (shouldNegate) { value = -value; }
|
||||
switch (valpos) {
|
||||
case 0: inOutputCol += value; break;
|
||||
case 1: inSourceIndex += value; break;
|
||||
case 2: inSourceLine += value; break;
|
||||
case 3: inSourceCol += value; break;
|
||||
}
|
||||
valpos++;
|
||||
value = shift = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
commit();
|
||||
while (outputLine < source.sourceLines) {
|
||||
this.mappings.addByte(59);
|
||||
outputLine++;
|
||||
}
|
||||
}
|
||||
|
||||
toContent(): Buffer {
|
||||
return this.outputBuffer.toBuffer();
|
||||
}
|
||||
|
||||
toSourceMap(sourceRoot?: string): SourceMap {
|
||||
return { version: 3, sourceRoot, sources: this.sources, mappings: this.mappings.toBuffer().toString() };
|
||||
}
|
||||
}
|
||||
|
||||
export interface SourceMap {
|
||||
version: number; // always 3
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
sources: string[];
|
||||
sourcesContent?: string[];
|
||||
names?: string[];
|
||||
mappings: string | Buffer;
|
||||
}
|
||||
|
||||
const charToInteger = Buffer.alloc(256);
|
||||
const integerToChar = Buffer.alloc(64);
|
||||
|
||||
charToInteger.fill(255);
|
||||
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split('').forEach((char, i) => {
|
||||
charToInteger[char.charCodeAt(0)] = i;
|
||||
integerToChar[i] = char.charCodeAt(0);
|
||||
});
|
||||
|
||||
class DynamicBuffer {
|
||||
private buffer: Buffer;
|
||||
private size: number;
|
||||
|
||||
constructor() {
|
||||
this.buffer = Buffer.alloc(512);
|
||||
this.size = 0;
|
||||
}
|
||||
|
||||
ensureCapacity(capacity: number) {
|
||||
if (this.buffer.length >= capacity) {
|
||||
return;
|
||||
}
|
||||
const oldBuffer = this.buffer;
|
||||
this.buffer = Buffer.alloc(Math.max(oldBuffer.length * 2, capacity));
|
||||
oldBuffer.copy(this.buffer);
|
||||
}
|
||||
|
||||
addByte(b: number) {
|
||||
this.ensureCapacity(this.size + 1);
|
||||
this.buffer[this.size++] = b;
|
||||
}
|
||||
|
||||
addVLQ(num: number) {
|
||||
let clamped: number;
|
||||
|
||||
if (num < 0) {
|
||||
num = (-num << 1) | 1;
|
||||
} else {
|
||||
num <<= 1;
|
||||
}
|
||||
|
||||
do {
|
||||
clamped = num & 31;
|
||||
num >>= 5;
|
||||
|
||||
if (num > 0) {
|
||||
clamped |= 32;
|
||||
}
|
||||
|
||||
this.addByte(integerToChar[clamped]);
|
||||
} while (num > 0);
|
||||
}
|
||||
|
||||
addString(s: string) {
|
||||
const l = Buffer.byteLength(s);
|
||||
this.ensureCapacity(this.size + l);
|
||||
this.buffer.write(s, this.size);
|
||||
this.size += l;
|
||||
}
|
||||
|
||||
addBuffer(b: Buffer) {
|
||||
this.ensureCapacity(this.size + b.length);
|
||||
b.copy(this.buffer, this.size);
|
||||
this.size += b.length;
|
||||
}
|
||||
|
||||
toBuffer(): Buffer {
|
||||
return this.buffer.slice(0, this.size);
|
||||
}
|
||||
}
|
||||
|
||||
function countNL(b: Buffer): number {
|
||||
let res = 0;
|
||||
for (let i = 0; i < b.length; i++) {
|
||||
if (b[i] === 10) { res++; }
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// #endregion
|
||||
@@ -9,13 +9,10 @@ set VSCODELOGSDIR=%~dp0\..\.build\logs\integration-tests
|
||||
|
||||
:: Figure out which Electron to use for running tests
|
||||
if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
|
||||
:: Run out of sources: no need to compile as code.bat takes care of it
|
||||
chcp 65001
|
||||
set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat
|
||||
set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1
|
||||
|
||||
echo Storing crash reports into '%VSCODECRASHDIR%'.
|
||||
echo Storing log files into '%VSCODELOGSDIR%'.
|
||||
echo Running integration tests out of sources.
|
||||
) else (
|
||||
:: Run from a built: need to compile all test extensions
|
||||
@@ -27,7 +24,6 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
|
||||
:: compile-extension:vscode-api-tests^
|
||||
:: compile-extension:vscode-colorize-tests^
|
||||
:: compile-extension:markdown-language-features^
|
||||
:: compile-extension:typescript-language-features^
|
||||
:: compile-extension:vscode-custom-editor-tests^
|
||||
:: compile-extension:emmet^
|
||||
:: compile-extension:css-language-features-server^
|
||||
@@ -40,8 +36,6 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
|
||||
set VSCODE_CLI=1
|
||||
set ELECTRON_ENABLE_LOGGING=1
|
||||
|
||||
echo Storing crash reports into '%VSCODECRASHDIR%'.
|
||||
echo Storing log files into '%VSCODELOGSDIR%'.
|
||||
echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build.
|
||||
)
|
||||
|
||||
@@ -67,9 +61,6 @@ set ALL_PLATFORMS_API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip
|
||||
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS%
|
||||
:: if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test\unit %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS%
|
||||
:: if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\markdown-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\markdown-language-features --extensionTestsPath=%~dp0\..\extensions\markdown-language-features\out\test %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS%
|
||||
:: if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
|
||||
@@ -22,11 +22,8 @@ cd $ROOT
|
||||
# Figure out which Electron to use for running tests
|
||||
if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ]
|
||||
then
|
||||
# Run out of sources: no need to compile as code.sh takes care of it
|
||||
INTEGRATION_TEST_ELECTRON_PATH="./scripts/code.sh"
|
||||
|
||||
echo "Storing crash reports into '$VSCODECRASHDIR'."
|
||||
echo "Storing log files into '$VSCODELOGSDIR'."
|
||||
echo "Running integration tests out of sources."
|
||||
else
|
||||
# Run from a built: need to compile all test extensions
|
||||
@@ -39,7 +36,6 @@ else
|
||||
# compile-extension:vscode-colorize-tests \
|
||||
# compile-extension:vscode-custom-editor-tests \
|
||||
# compile-extension:markdown-language-features \
|
||||
# compile-extension:typescript-language-features \
|
||||
# compile-extension:emmet \
|
||||
# compile-extension:css-language-features-server \
|
||||
# compile-extension:html-language-features-server \
|
||||
@@ -53,11 +49,12 @@ else
|
||||
export ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
export ELECTRON_ENABLE_LOGGING=1
|
||||
|
||||
echo "Storing crash reports into '$VSCODECRASHDIR'."
|
||||
echo "Storing log files into '$VSCODELOGSDIR'."
|
||||
echo "Running integration tests with '$INTEGRATION_TEST_ELECTRON_PATH' as build."
|
||||
fi
|
||||
|
||||
echo "Storing crash reports into '$VSCODECRASHDIR'."
|
||||
echo "Storing log files into '$VSCODELOGSDIR'."
|
||||
|
||||
if [ -z "$INTEGRATION_TEST_APP_NAME" ]; then
|
||||
after_suite() { true; }
|
||||
else
|
||||
|
||||
@@ -19,7 +19,7 @@ IF "%VSCODEUSERDATADIR%" == "" (
|
||||
set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%
|
||||
)
|
||||
|
||||
set REMOTE_VSCODE=%AUTHORITY%%EXT_PATH%
|
||||
set REMOTE_EXT_PATH=%AUTHORITY%%EXT_PATH%
|
||||
set VSCODECRASHDIR=%~dp0\..\.build\crashes
|
||||
set VSCODELOGSDIR=%~dp0\..\.build\logs\integration-tests-remote
|
||||
set TESTRESOLVER_DATA_FOLDER=%TMP%\testresolverdatafolder-%RANDOM%-%TIME:~6,5%
|
||||
@@ -32,45 +32,80 @@ if "%VSCODE_REMOTE_SERVER_PATH%"=="" (
|
||||
echo Using '%VSCODE_REMOTE_SERVER_PATH%' as server path
|
||||
)
|
||||
|
||||
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --disable-keytar --disable-inspect --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
|
||||
|
||||
:: Figure out which Electron to use for running tests
|
||||
if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
|
||||
echo Storing crash reports into '%VSCODECRASHDIR%'
|
||||
echo Storing log files into '%VSCODELOGSDIR%'
|
||||
chcp 65001
|
||||
set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat
|
||||
set API_TESTS_EXTRA_ARGS_BUILT=
|
||||
|
||||
:: Tests in the extension host running from sources
|
||||
call .\scripts\code.bat --folder-uri=%REMOTE_VSCODE%/vscode-api-tests/testWorkspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/singlefolder-tests %API_TESTS_EXTRA_ARGS%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
call .\scripts\code.bat --file-uri=%REMOTE_VSCODE%/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/workspace-tests %API_TESTS_EXTRA_ARGS%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
echo Running integration tests out of sources.
|
||||
) else (
|
||||
echo Storing crash reports into '%VSCODECRASHDIR%'
|
||||
echo Storing log files into '%VSCODELOGSDIR%'
|
||||
echo Using %INTEGRATION_TEST_ELECTRON_PATH% as Electron path
|
||||
|
||||
:: Run from a built: need to compile all test extensions
|
||||
:: because we run extension tests from their source folders
|
||||
:: and the build bundles extensions into .build webpacked
|
||||
:: call yarn gulp compile-extension:vscode-api-tests^
|
||||
:: compile-extension:microsoft-authentication^
|
||||
:: compile-extension:github-authentication^
|
||||
:: compile-extension:vscode-test-resolver
|
||||
|
||||
:: Configuration for more verbose output
|
||||
set VSCODE_CLI=1
|
||||
set ELECTRON_ENABLE_LOGGING=1
|
||||
set ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
|
||||
:: Tests in the extension host running from built version (both client and server)
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%REMOTE_VSCODE%/vscode-api-tests/testWorkspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/singlefolder-tests %API_TESTS_EXTRA_ARGS% --extensions-dir=%EXT_PATH% --enable-proposed-api=vscode.vscode-test-resolver --enable-proposed-api=vscode.vscode-api-tests
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
:: Extra arguments only when running against a built version
|
||||
set API_TESTS_EXTRA_ARGS_BUILT=--extensions-dir=%EXT_PATH% --enable-proposed-api=vscode.vscode-test-resolver --enable-proposed-api=vscode.vscode-api-tests
|
||||
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --file-uri=%REMOTE_VSCODE%/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/workspace-tests %API_TESTS_EXTRA_ARGS% --extensions-dir=%EXT_PATH% --enable-proposed-api=vscode.vscode-test-resolver --enable-proposed-api=vscode.vscode-api-tests
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
echo Using %INTEGRATION_TEST_ELECTRON_PATH% as Electron path
|
||||
)
|
||||
|
||||
echo Storing crash reports into '%VSCODECRASHDIR%'
|
||||
echo Storing log files into '%VSCODELOGSDIR%'
|
||||
|
||||
|
||||
:: Tests in the extension host
|
||||
|
||||
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --disable-keytar --disable-inspect --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
|
||||
|
||||
echo.
|
||||
echo ### API tests (folder)
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%REMOTE_EXT_PATH%/vscode-api-tests/testWorkspace --extensionDevelopmentPath=%REMOTE_EXT_PATH%/vscode-api-tests --extensionTestsPath=%REMOTE_EXT_PATH%/vscode-api-tests/out/singlefolder-tests %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### API tests (workspace)
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --file-uri=%REMOTE_EXT_PATH%/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=%REMOTE_EXT_PATH%/vscode-api-tests --extensionTestsPath=%REMOTE_EXT_PATH%/vscode-api-tests/out/workspace-tests %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### TypeScript tests
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%REMOTE_EXT_PATH%/typescript-language-features/test-workspace --extensionDevelopmentPath=%REMOTE_EXT_PATH%/typescript-language-features --extensionTestsPath=%REMOTE_EXT_PATH%/typescript-language-features\out\test\unit %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Markdown tests
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%REMOTE_EXT_PATH%/markdown-language-features/test-workspace --extensionDevelopmentPath=%REMOTE_EXT_PATH%/markdown-language-features --extensionTestsPath=%REMOTE_EXT_PATH%/markdown-language-features/out/test %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Emmet tests
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%REMOTE_EXT_PATH%/emmet/test-workspace --extensionDevelopmentPath=%REMOTE_EXT_PATH%/emmet --extensionTestsPath=%REMOTE_EXT_PATH%/emmet/out/test %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Git tests
|
||||
for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i
|
||||
set GITWORKSPACE=%TEMPDIR%\git-%RANDOM%
|
||||
mkdir %GITWORKSPACE%
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%AUTHORITY%%GITWORKSPACE% --extensionDevelopmentPath=%REMOTE_EXT_PATH%/git --extensionTestsPath=%REMOTE_EXT_PATH%/git/out/test %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Ipynb tests
|
||||
set IPYNBWORKSPACE=%TEMPDIR%\ipynb-%RANDOM%
|
||||
mkdir %IPYNBWORKSPACE%
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%AUTHORITY%%IPYNBWORKSPACE% --extensionDevelopmentPath=%REMOTE_EXT_PATH%/ipynb --extensionTestsPath=%REMOTE_EXT_PATH%/ipynb/out/test %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Configuration editing tests
|
||||
set CFWORKSPACE=%TEMPDIR%\cf-%RANDOM%
|
||||
mkdir %CFWORKSPACE%
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%AUTHORITY%/%CFWORKSPACE% --extensionDevelopmentPath=%REMOTE_EXT_PATH%/configuration-editing --extensionTestsPath=%REMOTE_EXT_PATH%/configuration-editing/out/test %API_TESTS_EXTRA_ARGS% %API_TESTS_EXTRA_ARGS_BUILT%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
:: Cleanup
|
||||
|
||||
IF "%3" == "" (
|
||||
rmdir /s /q %VSCODEUSERDATADIR%
|
||||
)
|
||||
|
||||
@@ -34,40 +34,19 @@ export REMOTE_VSCODE=$AUTHORITY$EXT_PATH
|
||||
# Figure out which Electron to use for running tests
|
||||
if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ]
|
||||
then
|
||||
# Run out of sources: no need to compile as code.sh takes care of it
|
||||
INTEGRATION_TEST_ELECTRON_PATH="./scripts/code.sh"
|
||||
|
||||
# No extra arguments when running out of sources
|
||||
EXTRA_INTEGRATION_TEST_ARGUMENTS=""
|
||||
|
||||
echo "Storing crash reports into '$VSCODECRASHDIR'."
|
||||
echo "Storing log files into '$VSCODELOGSDIR'."
|
||||
echo "Running remote integration tests out of sources."
|
||||
else
|
||||
# Run from a built: need to compile all test extensions
|
||||
# because we run extension tests from their source folders
|
||||
# and the build bundles extensions into .build webpacked
|
||||
# yarn gulp compile-extension:vscode-api-tests \
|
||||
# compile-extension:vscode-test-resolver \
|
||||
# compile-extension:markdown-language-features \
|
||||
# compile-extension:typescript-language-features \
|
||||
# compile-extension:emmet \
|
||||
# compile-extension:git \
|
||||
# compile-extension:ipynb \
|
||||
# compile-extension:configuration-editing \
|
||||
# compile-extension:microsoft-authentication \
|
||||
# compile-extension:github-authentication \
|
||||
# compile-extension-media
|
||||
|
||||
# Configuration for more verbose output
|
||||
export VSCODE_CLI=1
|
||||
export ELECTRON_ENABLE_LOGGING=1
|
||||
|
||||
# Running from a build, we need to enable the vscode-test-resolver extension
|
||||
EXTRA_INTEGRATION_TEST_ARGUMENTS="--extensions-dir=$EXT_PATH --enable-proposed-api=vscode.vscode-test-resolver --enable-proposed-api=vscode.vscode-api-tests"
|
||||
|
||||
echo "Storing crash reports into '$VSCODECRASHDIR'."
|
||||
echo "Storing log files into '$VSCODELOGSDIR'."
|
||||
echo "Running remote integration tests with $INTEGRATION_TEST_ELECTRON_PATH as build."
|
||||
fi
|
||||
|
||||
@@ -91,6 +70,12 @@ fi
|
||||
|
||||
API_TESTS_EXTRA_ARGS="--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --disable-keytar --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR"
|
||||
|
||||
echo "Storing crash reports into '$VSCODECRASHDIR'."
|
||||
echo "Storing log files into '$VSCODELOGSDIR'."
|
||||
|
||||
|
||||
# Tests in the extension host
|
||||
|
||||
echo
|
||||
echo "### API tests (folder)"
|
||||
echo
|
||||
|
||||
@@ -18,20 +18,11 @@ IF "%~1" == "" (
|
||||
set REMOTE_VSCODE=%AUTHORITY%%EXT_PATH%
|
||||
|
||||
if "%VSCODE_REMOTE_SERVER_PATH%"=="" (
|
||||
chcp 65001
|
||||
|
||||
echo Using remote server out of sources for integration web tests
|
||||
) else (
|
||||
echo Using '%VSCODE_REMOTE_SERVER_PATH%' as server path for web integration tests
|
||||
|
||||
:: Run from a built: need to compile all test extensions
|
||||
:: because we run extension tests from their source folders
|
||||
:: and the build bundles extensions into .build webpacked
|
||||
:: call yarn gulp compile-extension:vscode-api-tests^
|
||||
:: compile-extension:markdown-language-features^
|
||||
:: compile-extension:typescript-language-features^
|
||||
:: compile-extension:emmet^
|
||||
:: compile-extension:configuration-editing^
|
||||
:: compile-extension:git^
|
||||
:: compile-extension-media
|
||||
)
|
||||
|
||||
if not exist ".\test\integration\browser\out\index.js" (
|
||||
@@ -39,6 +30,9 @@ if not exist ".\test\integration\browser\out\index.js" (
|
||||
call yarn playwright-install
|
||||
)
|
||||
|
||||
|
||||
:: Tests in the extension host
|
||||
|
||||
echo.
|
||||
echo ### API tests (folder)
|
||||
call node .\test\integration\browser\out\index.js --workspacePath=.\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=.\extensions\vscode-api-tests --extensionTestsPath=.\extensions\vscode-api-tests\out\singlefolder-tests %*
|
||||
@@ -72,9 +66,20 @@ mkdir %GITWORKSPACE%
|
||||
call node .\test\integration\browser\out\index.js --workspacePath=%GITWORKSPACE% --extensionDevelopmentPath=.\extensions\git --extensionTestsPath=.\extensions\git\out\test %*
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Ipynb tests
|
||||
set IPYNBWORKSPACE=%TEMPDIR%\ipynb-%RANDOM%
|
||||
mkdir %IPYNBWORKSPACE%
|
||||
call node .\test\integration\browser\out\index.js --workspacePath=%IPYNBWORKSPACE% --extensionDevelopmentPath=.\extensions\ipynb --extensionTestsPath=.\extensions\ipynb\out\test %*
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Configuration editing tests
|
||||
set CFWORKSPACE=%TEMPDIR%\git-%RANDOM%
|
||||
mkdir %CFWORKSPACE%
|
||||
call node .\test\integration\browser\out\index.js --workspacePath=%CFWORKSPACE% --extensionDevelopmentPath=.\extensions\configuration-editing --extensionTestsPath=.\extensions\configuration-editing\out\test %*
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
popd
|
||||
|
||||
endlocal
|
||||
|
||||
@@ -15,18 +15,6 @@ then
|
||||
echo "Using remote server out of sources for integration web tests"
|
||||
else
|
||||
echo "Using $VSCODE_REMOTE_SERVER_PATH as server path for web integration tests"
|
||||
|
||||
# Run from a built: need to compile all test extensions
|
||||
# because we run extension tests from their source folders
|
||||
# and the build bundles extensions into .build webpacked
|
||||
# yarn gulp compile-extension:vscode-api-tests \
|
||||
# compile-extension:markdown-language-features \
|
||||
# compile-extension:typescript-language-features \
|
||||
# compile-extension:emmet \
|
||||
# compile-extension:git \
|
||||
# compile-extension:ipynb \
|
||||
# compile-extension:configuration-editing \
|
||||
# compile-extension-media
|
||||
fi
|
||||
|
||||
if [ ! -e 'test/integration/browser/out/index.js' ];then
|
||||
@@ -34,6 +22,7 @@ if [ ! -e 'test/integration/browser/out/index.js' ];then
|
||||
yarn playwright-install
|
||||
fi
|
||||
|
||||
|
||||
# Tests in the extension host
|
||||
|
||||
echo
|
||||
|
||||
@@ -8,6 +8,8 @@ const path = require('path');
|
||||
|
||||
const moduleNames = [
|
||||
'xterm',
|
||||
'xterm-addon-canvas',
|
||||
'xterm-addon-image',
|
||||
'xterm-addon-search',
|
||||
'xterm-addon-unicode11',
|
||||
'xterm-addon-webgl'
|
||||
@@ -30,7 +32,17 @@ function getLatestModuleVersion(moduleName) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
const versions = JSON.parse(stdout);
|
||||
let versions = JSON.parse(stdout);
|
||||
// HACK: Some bad versions were published as v5 which cannot be unpublished, ignore these
|
||||
if (moduleName === 'xterm-addon-canvas') {
|
||||
versions = versions.filter(e => ![
|
||||
'0.12.0',
|
||||
'5.0.0-beta.1',
|
||||
'5.0.0-beta.2',
|
||||
'5.0.0-beta.3',
|
||||
'5.0.0-beta.4',
|
||||
].includes(e));
|
||||
}
|
||||
resolve(versions[versions.length - 1]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user