TypeFox / monaco-components

Monaco Editor and Language Client Wrapper, plus Monaco Editor React Component
MIT License
42 stars 13 forks source link

Properly separate and define classic and extended editor #54

Closed kaisalmen closed 10 months ago

kaisalmen commented 11 months ago

@montymxb when I reviewed the tutorial update I realized that the terminology around classic editor and vscode-api is not properly defined here. This PR should cleans this up; in the code and the documentation.

monaco-vscode-api is the foundation for everything here and therefore using something like vscodApi for one of the editor config/modes is misleading. This PR corrects this:

In case of extended mode it is ensured textmate and theme services, plus the default themes are available when you use it. userConfiguration is now only available in this mode as the regular editorOptions should be used in *classic mode.

I spent some time cleaning EditorAppBase no longer depending on any code from extending classes. This is now cleaner. Sorry this PR grew a lot bigger than initially intended, but it helps if code and description are in-line.

next release are available for testing: https://www.npmjs.com/package/monaco-editor-wrapper/v/3.3.0-next.2 https://www.npmjs.com/package/@typefox/monaco-editor-react/v/2.3.0-next.2

This change will also make the Langium web template config easier as it removes the need for separate bundles, because everything required is configured on this level already. The latest commit there use the next version now.

The latest commit moves editorOptions, diffEditorOptions and overrideAutomaticLayout to EditorAppConfigBase. This allows to set editor parameters directly which may help overcome monaco-editor related configuration problems and wasn't present in extended mode before.