eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.84k stars 2.48k forks source link

Fix programmatic save for custom text editors #13684

Closed msujew closed 2 months ago

msujew commented 3 months ago

What it does

Closes https://github.com/eclipse-theia/theia/issues/9230

Instead of using the EditorManager (that seemingly doesn't keep track of CustomEditorWidget instances), we simply use the monaco model service to save the underlying model.

Also removes an unused RPC method $tryCloseDocument.

How to test

Follow the instructions in https://github.com/eclipse-theia/theia/issues/9230 and confirm that manual saving works as expected. Alternatively, the extension in https://github.com/eclipse-theia/theia/issues/12979 should now also work as expected.

Review checklist

Reminder for reviewers