-
Notifications
You must be signed in to change notification settings - Fork 36k
monaco editor playground #276161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
monaco editor playground #276161
Conversation
There was a problem hiding this 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
WebWorkerDescriptorfrom an interface to a class with support for both transpiled and bundler environments - Consolidating
EditorWorkerServiceimplementations by removing workbench and standalone-specific subclasses - Updating all web worker instantiation sites to use the new
WebWorkerDescriptorconstructor 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 |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
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.
| // 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. |
| "noEmit": true, | ||
| "strict": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "experimentalDecorators": true, |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
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.
| "experimentalDecorators": true, | |
| "experimentalDecorators": true |
| <p>Use the Playground Launch Config for a better dev experience</p> | ||
| <script src="./index.ts" type="module"></script> | ||
| </body> | ||
| </html> |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
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.
No description provided.