monaco-languageclient icon indicating copy to clipboard operation
monaco-languageclient copied to clipboard

Update code configuration. languageId is no longer required.

Open kaisalmen opened this issue 1 year ago • 4 comments

Re-work how to configure code in UserConfig and make languageId no longer required and do not enforce it in the editor model. This is now uri or file extension driven. languageId can be optionally enforced (WA for classical editor in the wrapper).

It is now possible to create an editor without any text or model and update the model or codeResources later. This is demonstrated here: https://github.com/TypeFox/monaco-languageclient/blob/issue-639/packages/examples/src/langium/statemachine/main.ts#L28-L42

Fixes #639

kaisalmen avatar May 03 '24 09:05 kaisalmen

@CGNonofr are the API changes still ok for a minor version change? WDYT?

kaisalmen avatar May 08 '24 06:05 kaisalmen

@CGNonofr are the API changes still ok for a minor version change? WDYT?

We should keep it simple:

  • fix = patch
  • feature = minor
  • breaking change = major

Is it backward compatible ?

CGNonofr avatar May 08 '24 06:05 CGNonofr

Is it backward compatible ?

The UserConfig is not. So, if you do it by the book it is a major version change. But the change is for the good, because what I did previously was too limiting.

kaisalmen avatar May 08 '24 06:05 kaisalmen

@CGNonofr I should add a couple of unit tests for this and I think the new version of wrapper and react comp should be major ones. Do you think this configuration approach for code text / model handling is an improvement?

kaisalmen avatar May 08 '24 07:05 kaisalmen

@CGNonofr this is ready for review now. Version changes and CHANGELOG adjustments will come later (not be part of this PR)

kaisalmen avatar May 10 '24 15:05 kaisalmen

@CGNonofr I just released the new versions on npm. I cleaned-up examples and did some further API alignments directly on main as I realised I missed something. monaco-languageclient is a minor change (8.4.0). The wrapper advanced to v5 and the react component advanced to v4.

kaisalmen avatar May 15 '24 07:05 kaisalmen