Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrow typing of Saveable.createSnapshot #11032

Merged

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Apr 14, 2022

What it does

Fixes: #11031.

In the Monaco uplift, the return of MonacoEditorModel.createSnapshot was changed, but its effect on the Saveable system was not detected because the return of Saveable.createSnapshot was typed as object. This PR narrows that typing so that callers of the function have some idea what to expect, and deviations from those expectations can be caught.

How to test

  1. Open two editors, one with an existing file and one Untitled.
  2. Use Save as on both editors
  3. In both cases, the content should be copied and the old editor closed.
  4. No errors should be logged about failures to create text buffers.

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added monaco issues related to monaco bug bugs found in the application labels Apr 14, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that the changes successfully fix #11031 👍

@colin-grant-work colin-grant-work added this to the 1.25.0 milestone Apr 20, 2022
@colin-grant-work colin-grant-work merged commit dd365b1 into eclipse-theia:master Apr 20, 2022
@colin-grant-work colin-grant-work deleted the bugfix/save-as-snapshot branch April 20, 2022 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application monaco issues related to monaco
Projects
None yet
Development

Successfully merging this pull request may close these issues.

editor: 'save as' does not work correctly
2 participants