The @theia/monaco extension contributes the integration of the monaco-editor.
This includes:
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.
@theia/monaco-editor-core.At the time of this writing the latest release tag is
1.108.2, and the uplift branch ismonaco_uplift_1.108.2(https://github.com/eclipsesource/ms-vscode/tree/monaco_uplift_1.108.2)
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.
npm install and npm run gulp editor-distro.build/monaco/package.jsondeclaration: true, sourceMap: true, moduleResolution: Classic).module.exports added).module.exports added).setTimeout0 with $globalThis.addEventListener check for non-browser environments.embeddedDiffEditorWidget import to editor.all.ts.For initial testing, it's easier to point dependencies to your local VSCode.
monaco-editor-core using the steps above.@theia/monaco-editor-core in package.jsons and replace their version with "file:/<your-path-to>/vscode/out-monaco-editor-core".Using
file: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.
node_modules and npm install and build Theia.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.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.
It may also be necessary to update our various
vscodedependencies 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-languageserver-protocolvscode-onigurumavscode-textmatevscode-uri
Once you believe that everything is in working order, you'll need to publish the new @theia/monaco-editor-core for testing.
You can use npm pack in the out-monaco-editor-core/ directory of the VSCode fork to create a tarball, then publish it.
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
See here for a detailed documentation.