Theia API Documentation v1.65.0
    Preparing search index...

    Module @theia/monaco


    theia-ext-logo

    ECLIPSE THEIA - MONACO EXTENSION


    The @theia/monaco extension contributes the integration of the monaco-editor.
    This includes:

    • full-feature code editor
    • diff-editor
    • code snippets
    • textmate grammars (theme registry, service)

    This package is intended to be the interface between the @theia/monaco-editor-core package, the project's bundling of the monaco-editor-core package published by the VSCode team, and the rest of the application. When we uplift to a new version of monaco-editor-core, this package will need to be checked particularly thoroughly. To facilitate that process, the steps for undertaking a Monaco uplift are outlined here.

    1. Clone the VSCode repo and make sure you have the following remotes:
    1. Find the latest release tag in the official VSCode repo, and the most recent uplift branch in the Theia fork.

    At the time of this writing the latest release tag is 1.96.3, and the uplift branch is monaco-uplift-1.96.3

    1. Check out the release tag, cherry pick the tip of the uplift branch, and resolve any conflicts.

    As you resolve conflicts and make changes to the VSCode repo, make sure you end up with a single commit on the uplift branch to make it easier for the next person to rebase.

    1. Try to build. At the moment, this means running npm install and npm run gulp editor-distro.
    2. Fix any build errors that arise.
    3. Change the version in build/monaco/package.json
    • build/gulpfile.editor.js: various changes to modify the treeshaking and output destinations.
    • build/lib/standalone.js/ts: changes to output sourcemaps etc. One small change to fix a build error due to having a directory named model and a file named model.ts in the same folder.
    • src/vs/base/browser/dompurify/dompurify.js changes for CommonJS rather than ESM
    • src/vs/base/common/marked/marked.js changes for CommonJS rather than ESM

    For initial testing, it's easier to point dependencies to your local VSCode.

    1. Having built monaco-editor-core using the steps above.
    2. Find all references to @theia/monaco-editor-core in package.jsons and replace their version with "link:<path to your local build of monaco-editor-core>".

    Using link: means that if you subsequently make changes on the VSCode side, you only need to rebuild VSCode and then rebuild Theia to see the effects.

    1. Delete your node_modules and npm install and build Theia.
    2. Fix any build errors.
    3. Uncomment the bindMonacoPreferenceExtractor function in examples/api-samples/src/browser/monaco-editor-preferences/monaco-editor-preference-extractor.ts and run the commands there. Fix the EditorGeneratedPreferenceSchema as necessary, and add or remove validations from the MonacoFrontendApplicationContribution as appropriate.
    4. Look for comments that indicate forced types or other code smells that would prevent a build error from being thrown where it should be thrown and check that the assertion still applies.

    If you add these, mark them with @monaco-uplift - that'll make them easier to find in the future. Better: if you can remove them, do! Typically, the cause is mixing imports from private API and public API. Often public API fails to satisfy private declarations.

    1. Test the application thoroughly - make sure everything's still working.

    It may also be necessary to update our various vscode dependencies to match the current state of VSCode. It may not be necessary to upgrade all (or any) of these to successfully adopt a new Monaco version, but if something is misbehaving inexplicably, checking dependencies is a reasonable place to start. Check on:

    • vscode-debugprotocol
    • vscode-languageserver-protocol
    • vscode-oniguruma
    • vscode-proxy-agent
    • vscode-ripgrep
    • vscode-textmate
    • vscode-uri

    Once you believe that everything is in working order, you'll need to publish the new @theia/monaco-editor-core for testing. The instructions for doing so are here. Once the package is published, point your package.jsons at the testing version and make sure everything still works, then make a PR.

    "Theia" is a trademark of the Eclipse Foundation https://www.eclipse.org/theia

    Theia - Monaco Extension

    See here for a detailed documentation.

    Modules

    content-hover-widget-patcher
    default-content-hover-widget-patcher
    index
    markdown-renderer/monaco-markdown-renderer
    monaco-bulk-edit-service
    monaco-code-action-save-participant
    monaco-code-action-service
    monaco-color-registry
    monaco-command
    monaco-command-registry
    monaco-command-service
    monaco-context-key-service
    monaco-context-menu
    monaco-diff-computer
    monaco-diff-editor
    monaco-diff-navigator-factory
    monaco-editor
    monaco-editor-content-menu
    monaco-editor-model
    monaco-editor-overlay-button
    monaco-editor-peek-view-widget
    monaco-editor-provider
    monaco-editor-service
    monaco-editor-zone-widget
    monaco-formatting-conflicts
    monaco-frontend-application-contribution
    monaco-frontend-module
    monaco-gotoline-quick-access
    monaco-gotosymbol-quick-access
    monaco-icon-registry
    monaco-indexed-db
    monaco-init
    monaco-keybinding
    monaco-keycode-map
    monaco-languages
    monaco-marker-collection
    monaco-menu
    monaco-mime-service
    monaco-outline-contribution
    monaco-outline-decorator
    monaco-quick-access-registry
    monaco-quick-input-service
    monaco-resolved-keybinding
    monaco-snippet-suggest-provider
    monaco-standalone-theme-service
    monaco-status-bar-contribution
    monaco-text-model-service
    monaco-theming-service
    monaco-to-protocol-converter
    monaco-undo-redo-handler
    monaco-utilities
    monaco-workspace
    monaco-workspace-context-service
    protocol-to-monaco-converter
    simple-monaco-editor
    textmate
    textmate/monaco-textmate-frontend-bindings
    textmate/monaco-textmate-service
    textmate/monaco-theme-registry
    textmate/monaco-theme-types
    textmate/textmate-contribution
    textmate/textmate-registry
    textmate/textmate-snippet-completion-provider
    textmate/textmate-tokenizer
    workspace-symbol-command