-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Patch VS Code to wait for storage write #2049
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
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.
What's causing so many lines in the patch to change?
* operation to either the current workspace only or all workspaces. | ||
*/ | ||
- store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): void; | ||
+ store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> | void; |
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.
Why | void
?
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.
There are a bunch of tests that implement this interface. We could modify them all to return promises instead of void but it would increase the patch size a decent amount.
It looks like my version of git outputs index hashes that are 10 characters in length while the version used by the last person to generate the patch outputs 11 characters. As far as I can tell this isn't configurable yet (it will be in the next version). But I'm thinking we should modify the patch script to use |
VS Code has a short delay before writing storage (probably to queue up rapid changes). In the web version of VS Code this happens on the client which means if the page is reloaded before the delay expires the write never happens. Storage updates are already promises so this simply returns the promise returned by the delayer so it won't resolve until the write actually happens. Fixes #2021.
6f33ea4
to
7614045
Compare
I removed the extraneous hash updates. 😄 |
Sounds good, go ahead and do that! |
In a separate commit of course. |
Confirmed that it fixes rust-lang/rust-analyzer#5892 (reported in #2021).