-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 monaco model reference creation #14957
Conversation
28499a7
to
4db1f75
Compare
4db1f75
to
e66f900
Compare
@msujew Thanks for the work! Question: Can we somehow disconnect a Monaco Editor from the PluginHost instead of fully integrating them? For example we don't want the If this is off-topic we can also deal with this in a follow up of course Edit: Looking at the code, it seems you did exactly that with the |
Yes, the filter will prevent the model from being propagated to to plugin host. However, in order to prevent the errors from being logged, we currently want to send the models to the plugin host. A different fix for this would include 2 parts:
|
@sdirix the monaco |
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.
Looks like a nice solution to me.
Im just getting a few different errors sometimes when opening notebooks like:
Assertion failed (document 'vscode-notebook-cell:/c%3A/Typefox/Open_Source/theia_test_workspace/notebooks/1-cell-test.ipynb#W3sZmlsZQ%3D%3D' doesn't exist
or
A resource provider for 'vscode-notebook-cell:/c%3A/Typefox/Open_Source/theia_test_workspace/notebooks/1-cell-test.ipynb#W0sZmlsZQ%3D%3D
But thats probably out of scope for this PR?
I can confirm that #14924 is still fixed! |
@jonah-iden I can't really reproduce those error logs. I would assume they're either unrelated or a consequence of existing errors that are only uncovered through this change. I would indeed try to fix them in a separate PR. |
What it does
Closes #7671
Closes #14842
As outlined in #14842, the culprit for a lot of these issues seem to be that we don't actually create real
MonacoEditorModel
references for our inline editors. These models weren't synced with the plugin host and so we encountered a ton of errors within the plugin host which were then simply propagated and logged in the frontend.This fixes the issue by ensuring that we actually create a
Resource
for eachMonacoEditorModel
that we attempt to create. This ensures that the models are correctly send to the plugin host.Additionally adjusts how we create editor models for the notebook to ensure that they are all placed in one single reference list. Previously we had 2 lists, which then led to clashes inside of monaco.
Also fixes a very minor issue related to completion and language support in notebook editors.
How to test
.ipynb
) file and scroll through it.Please also ensure that #14924 remains fixed. I couldn't reproduce it (but I also only tested on Windows)
Review checklist
Reminder for reviewers