Skip to content

feat: update @theia/monaco-editor-core to 1.108.201#17140

Merged
ndoschek merged 5 commits intomasterfrom
GH-16401-uplift-monaco
Mar 17, 2026
Merged

feat: update @theia/monaco-editor-core to 1.108.201#17140
ndoschek merged 5 commits intomasterfrom
GH-16401-uplift-monaco

Conversation

@ndoschek
Copy link
Member

@ndoschek ndoschek commented Mar 9, 2026

What it does

Resolves GH-16401
Resolves parts of GH-10844
Resolves GH-16233
Fixes GH-16939

Uplifts @theia/monaco-editor-core from 1.96.302 to 1.108.201 and adapts the codebase to all API changes introduced in the new version.

Key changes:

  • Bump @theia/monaco-editor-core to 1.108.201 across all packages
  • Adapt to renamed/restructured Monaco APIs (MarkdownRenderer, BareFontInfo, InlineCompletions, etc.)
  • Move NLS localization override from runtime patching to a webpack alias with a dedicated monaco-nls.ts module
  • Build editor.worker in a separate webpack config without the NLS alias
  • Add ILayoutService override so Monaco UI (quick input) is positioned relative to the application shell
  • Add StandaloneServices fallback injection for cases where initialization happens prematurely
  • Fix editor focus for Monaco 1.108's native EditContext API (div.native-edit-context instead of textarea)
  • Fix visual tab preview for hidden Monaco editors by temporarily staging the model for canvas capture
  • Update editor.experimental.preferTreeSitter from a single array preference to per-language boolean preferences (css, typescript, ini, regex)
  • Add DEFAULT_SUPPORTED_MONACO_VERSION constant and display it in the About dialog
  • Undefine globalThis.navigator in the extension host for Node 21+ compatibility (Implement Workaround for globalThis.navigator being defined in Node 21+ #16233)

Checklist from the issue:

  • editor.experimental.preferTreeSitter: migrated from array to per-language booleans
  • Visual preview for Monaco editors: fixed by staging the model before preview capture
  • executeEdits workaround: already addressed via fallback to direct model edits
  • QuickInputButton location/toggle support: implemented

Notes:

How to test

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Contributed on behalf of STMicroelectronics

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Mar 9, 2026
@ndoschek ndoschek force-pushed the GH-16401-uplift-monaco branch from be1fdc2 to 25d1e2d Compare March 9, 2026 17:03
@ndoschek ndoschek marked this pull request as ready for review March 10, 2026 14:55
@ndoschek ndoschek requested review from colin-grant-work and sdirix and removed request for sdirix March 10, 2026 14:55
@ndoschek ndoschek force-pushed the GH-16401-uplift-monaco branch from 80bf244 to f2958d5 Compare March 11, 2026 14:13
Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

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

Monaco functionality appears to be working correctly 👍 .

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Needs merge in PR Backlog Mar 13, 2026
Resolves GH-16233

  - Override globalThis.navigator with undefined in plugin host and
    headless plugin host processes to restore the browser-detection
    pattern used by VS Code extensions
  - Add extensions.supportNodeGlobalNavigator preference (default: false)
    to opt in to the Node-provided navigator object
  - Register PluginHostNavigatorEnvironmentVariable to propagate the
    preference as THEIA_SUPPORT_NODE_GLOBAL_NAVIGATOR env var
  - Move preference schema to main/common/ so it can be shared between
    frontend and backend modules
  - Use PluginHostNavigatorState constant instead of directly injecting
    PreferenceService into HostedPluginProcess, which would cause async
    DI errors in connection-scoped containers
  - Add PluginHostNavigatorStateInitializer contribution to keep the
    state in sync with the preference value from the root container

Contributed on behalf of STMicroelectronics
- Remove stale matrix.tests != 'skip' guards (no tests dimension exists in the matrix)
- Drop the Node 22.x entry now that GH-16233 is resolved

Contributed on behalf of STMicroelectronics
- Add DEFAULT_SUPPORTED_MONACO_VERSION to api.ts
- Show Monaco editor version in the About dialog

Contributed on behalf of STMicroelectronics
Resolves GH-16401

- Bump @theia/monaco-editor-core from 1.96.302 to 1.108.201
- Replace editor.experimental.preferTreeSitter array preference with
  per-language boolean preferences (css, typescript, ini, regex)
- Update MonacoContextMenuService to expose onDidShowContextMenu and
  onDidHideContextMenu as property initializers matching the updated
  IContextMenuService interface
- Add onDidShowContextMenu/onDidHideContextMenu Event.None stubs to
  the inline IContextMenuService override in createInline(), fixing
  ContentHoverController crash
- Fix focus/blur for Monaco 1.108 EditContext API by querying
  .native-edit-context before falling back to textarea
- Add stageForPreview/unstagePreview to MonacoEditor and EditorWidget
  so visual tab previews render correctly when editors are hidden
  (model is set to null)
- Add MonacoLayoutService override so Monaco UI elements position
  relative to the Theia application shell
- Add MonacoWorkspaceContextService override
- Display Monaco editor version in About dialog
- Remove the focus/blur workaround that manually targeted the textarea
  or native-edit-context element, this.editor.focus() works correctly
  with modern Monaco
- Remove the now-unused blur() method from TextEditor interface and
  MonacoEditor
- Add console.warn when StandaloneServices overrides had to be
  patched in after premature initialization, and console.error when
  services were already instantiated and cannot be overridden

Contributed on behalf of STMicroelectronics
- Add ESM loader hooks in @theia/test-setup to handle .css imports
  from @theia/monaco-editor-core ESM bundles during mocha test runs
- Fix expose-loader to use module.exports instead of this for webpack
  compatibility with ESM modules, where this is undefined in arrow
  function wrappers
- Move top-level const { timeout } declarations inside describe()
  blocks to avoid duplicate identifier errors when files share scope
- Replace keyboard.type() with keyboard.insertText() in Playwright
  tests for Monaco EditContext API compatibility
- Add TheiaMonacoEditor.typeText() static helper that handles
  multi-line text (insertText for content, Enter for newlines)
- Update line-numbers selector to .margin-view-overlays .line-numbers
  to match Monaco 1.108 DOM
- Add retry logic to navigator test cleanup on Windows to handle
  EBUSY errors from unreleased file handles after move operations

Contributed on behalf of STMicroelectronics
@ndoschek ndoschek force-pushed the GH-16401-uplift-monaco branch from f2958d5 to f8d5101 Compare March 17, 2026 12:49
@ndoschek
Copy link
Member Author

Thanks for the review, @colin-grant-work 🙌

I had to rebase the branch and already squashed the commits into fewer ones.
The 3PP License Check is currently failing due to an upstream issue with the JAR download, but I am working resolving this (see #17169).
I ran the license check locally in the meantime, and no further checks are needed:

[main] INFO Vetted license information was found for all content. No further investigation is required.
INFO: Found no dependency that requires further investigation. Good job!
INFO: Done.

@ndoschek ndoschek merged commit a1b55dd into master Mar 17, 2026
10 of 11 checks passed
@ndoschek ndoschek deleted the GH-16401-uplift-monaco branch March 17, 2026 13:21
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Mar 17, 2026
@github-actions github-actions bot added this to the 1.70.0 milestone Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

2 participants