Skip to content

Conversation

@hediet
Copy link
Member

@hediet hediet commented Nov 7, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 7, 2025 18:49
@hediet hediet self-assigned this Nov 7, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the web worker initialization system in VS Code, consolidating worker service implementations and introducing bundler support. The key changes include:

  • Refactoring WebWorkerDescriptor from an interface to a class with support for both transpiled and bundler environments
  • Consolidating EditorWorkerService implementations by removing workbench and standalone-specific subclasses
  • Updating all web worker instantiation sites to use the new WebWorkerDescriptor constructor pattern
  • Adding a Monaco Editor playground using Vite for development testing

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/base/browser/webWorkerFactory.ts Converts IWebWorkerDescriptor interface to WebWorkerDescriptor class with support for both transpiled and bundler module locations
src/vs/editor/browser/services/editorWorkerService.ts Consolidates editor worker service by making it non-abstract and moving worker descriptor creation inline; registers as singleton
src/vs/workbench/contrib/codeEditor/browser/workbenchEditorWorkerService.ts Removes workbench-specific worker service wrapper (entire file deleted)
src/vs/editor/standalone/browser/standaloneServices.ts Removes standalone-specific worker service implementation
src/vs/workbench/workbench.common.main.ts Removes workbench worker service registration now handled in base service
src/vs/workbench/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.ts Updates to new WebWorkerDescriptor constructor pattern
src/vs/workbench/services/search/browser/searchService.ts Updates to new WebWorkerDescriptor constructor pattern
src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.ts Updates to new WebWorkerDescriptor constructor pattern
src/vs/workbench/contrib/output/browser/outputLinkProvider.ts Updates to new WebWorkerDescriptor constructor pattern
src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.ts Updates to new WebWorkerDescriptor constructor pattern
src/vs/platform/profiling/electron-browser/profileAnalysisWorkerService.ts Updates to new WebWorkerDescriptor constructor pattern
src/vs/editor/contrib/suggest/test/browser/wordDistance.test.ts Updates test to match new EditorWorkerService constructor signature
build/monaco-editor-playground/* Adds new Vite-based playground for testing Monaco Editor in bundler environments
.vscode/tasks.json Updates task configuration to use Vite for playground
.vscode/launch.json Updates launch configurations for new playground setup
build/npm/dirs.js Adds playground directory to npm directory list
Files not reviewed (1)
  • build/monaco-editor-playground/package-lock.json: Language not supported

return esmWorkerLocation.toString(true);
}
} catch (e) {
// ignore
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment 'ignore' does not explain what error condition is being ignored or why. Consider adding a more descriptive comment explaining that errors from FileAccess.asBrowserUri may occur in bundler environments and are safely ignored as the bundler location will be used as fallback.

Suggested change
// ignore
// Errors from accessing esmModuleLocation (e.g., FileAccess.asBrowserUri) may occur in bundler environments.
// These errors are safely ignored as the bundler location (esmModuleLocationBundler) will be used as a fallback below.

Copilot uses AI. Check for mistakes.
"noEmit": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tsconfig.json has a trailing comma after the last property in the compilerOptions object (line 7). While this is valid JSON5 and works in TypeScript, it's inconsistent with standard JSON formatting. Consider removing the trailing comma for better compatibility.

Suggested change
"experimentalDecorators": true,
"experimentalDecorators": true

Copilot uses AI. Check for mistakes.
<p>Use the Playground Launch Config for a better dev experience</p>
<script src="./index.ts" type="module"></script>
</body>
</html>
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML file is missing the required <head> section and character encoding declaration. Add <head><meta charset=\"UTF-8\"><title>Monaco Editor Playground</title></head> to ensure proper rendering and document structure.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants