-
-
Notifications
You must be signed in to change notification settings - Fork 489
fix: let the resource finish all write operation #1972
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
Conversation
before checking if it's in sync or not. Closes #437 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
8d97790
to
2b17b2b
Compare
I downloaded the PR as a Windows 64 zip file and installed it. About lists it as
Version: 2.0.5-snapshot-baf98f0
Date: 2023年03月21日T09:51:03.186Z
CLI Version: {3}
Copyright © 2023 Arduino SA
Next I loaded a sketch, enabled all the skip whitespace options, particularly the "trimAutoWhitespace" which provided the current work around.
Editing did not exhibit the, by now, well known cursor jumping randomly to the start of the line. I then closed the snapshot version, leaving the whitespace settings as is, and loaded my previous nightly. This immediately had the cursor jumping to the start problem. Back to the PR version and all seems to behave correctly. I will continue using this till it is merged into the next nightly. Should I experience any problems I will report here.
So it seems as if the proposed fix does exactly what it is intended to. Thanks for the hard work.
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.
I am able to consistently reproduce #437 on one of my computers with the build from main
. I am not able to reproduce it on that machine with the build from this PR.
Thanks Akos! Excellent work tracking down the bug.
Uh oh!
There was an error while loading. Please reload this page.
Motivation
As noted in eclipse-theia/theia#12327, there could be a race condition when saving the editor model. This PR customizes the file resource resolver to create instances that wait for all running write operations to finish before checking whether the resource is in sync.
Change description
Other information
It's not trivial to verify the changes. Without this PR, the bug can be reproduced with these steps.
to_verify_jumping_cursor.mp4
I could not reproduce it with my changes, although I repeated the steps ~100 times.
Reviewer checklist
Closes #437