Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
*.vsix
dist
.vscode-test
.vscode-test-web/
*.temp
*.tmp
tmp.*
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ VS Code profile. This case uses an unavailable R executable and downloads the
pinned webR assets. It checks Outline and Go to Definition across two unsaved R
documents, then edits a declaration and checks the new symbol.

## Testing VS Code for the Web

Run `pnpm run test:web` for the headless Chromium suite. The test runner downloads VS Code for the Web, the R syntax extension, and Playwright's Chromium. The first R session fetches the pinned webR assets and package library over HTTPS. Linux CI images also need the Playwright browser system dependencies. To provision Chromium and its system dependencies explicitly for the tested runner, run `pnpm dlx playwright@1.65.1 install --with-deps chromium` before the suite.

The suite opens virtual and unsaved documents, runs editor commands, transfers files, exercises cancellation on a cross-origin isolated workbench, and reopens a saved Interactive transcript. Manually testing a browser development extension on `vscode.dev` can prompt for notebook trust when opening a notebook for the first time.

### Releasing the webR language service

The VSIX includes the R-universe `wasm32-unknown-emscripten` languageserver
Expand Down
17 changes: 16 additions & 1 deletion esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ async function main() {
logLevel: 'info',
});

const browserExtensionCtx = await esbuild.context({
entryPoints: ['./src/web/extension.ts'],
outfile: 'dist/web-extension.js',
format: 'cjs',
platform: 'browser',
bundle: true,
// webR's Node entry imports worker_threads. The upstream browser
// distribution uses a Web Worker with the same JavaScript API.
alias: { webr: path.join(__dirname, 'node_modules/webr/dist/webr.js') },
external: ['vscode'],
minify: production,
sourcemap: !production,
sourcesContent: false,
});

// A session agent remains alive after the extension host exits.
const agentCtx = await esbuild.context({
entryPoints: ['./src/interactive/agentMain.ts'],
Expand Down Expand Up @@ -119,7 +134,7 @@ async function main() {
logLevel: 'info',
});

const contexts = [extensionCtx, agentCtx, interactiveRendererCtx, webviewCtx];
const contexts = [extensionCtx, browserExtensionCtx, agentCtx, interactiveRendererCtx, webviewCtx];
if (watch) {
await Promise.all(contexts.map(context => context.watch()));
console.log('Watching for changes...');
Expand Down
Loading
Loading