-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Fix Diff Editor Model Refs #696
Conversation
@zgbpr thank you for spotting this and providing the fix. Can you please add a unit test? https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper/test/wrapper.test.ts#L114-L133 should be a good template to derive a new test from. |
Thanks for the suggestion, @kaisalmen! Since that test already creates and verifies the model references, I added a few more Let me know if you'd prefer to verify the names in a separate test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you'd prefer to verify the names in a separate test.
No, that is fine. Thank you. LGTM
Thanks @kaisalmen! Do you happen to know when these changes might be included with a release? |
Amazing, thank you! 🙏 |
Hmm, I pulled down v4.3.1 of Any chance that there needs to be a v5.3.1 release of |
Sorry, my fault. New versions will come soon. |
Thank you for the quick updates, @kaisalmen! That's working well. 🎉 |
Summary
Fixes a bug that caused both diff editors to display the same model.
Details
We ran into a bug with the diff editor where both the modified editor and original editor displayed the same content. When we inspected the editors in the browser, we found that they had the same
data-uri
value.After tracing through the
editorAppBase.ts
file, we saw that thegetEditorUri
function accepts a boolean to determine whether to append 'Original'. But thebuildModelRef
function always passedfalse
when building the model reference for both editors.This pull request fixes the bug by passing a boolean parameter from
buildModelRef
togetEditorUri
and ensuring that the URIs are different for both editors.Screenshots
Here is a screenshot before the change, showing how the modified editor and original editor displayed the same content.
Here is a screenshot after the change, showing how the modified editor and original editor now display different content.