-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[relay-lsp] Ensure documents are synced before calculating completions #4473
Conversation
bfe32bd
to
d9c28f5
Compare
Interesting! Looks reasonable, but are you able to validate this change on its own, or do we need the VSCode fix as well? |
I would say it catches 40% of the race conditions between |
d92878d
to
3faf115
Compare
It seems like all the issues were being caused by the TaskQueue essentially fire-and-forgetting the processing of tasks. I opted to execute all the notification tasks concerning the document content, e.g. I also verified that this fixes the problems in my PR adding folding features: #4480 |
Have been using a local build of the LSP (from this PR) in our project for two days now and can verify that I haven't had a wrong completion since 🤩 |
While this already works really reliably, I'd like to extend the solution with something a little bit more sophisticated to also wait for ongoing Will need to smarten up on Rust synchronization mechanisms first though 😅 |
7a792f8
to
01dcf08
Compare
b8ef5e9
to
b0e6731
Compare
b0e6731
to
eee733d
Compare
eee733d
to
0ddfeac
Compare
@captbaritone @alunyov this would be ready to review :) I've also made a quick recording to showcase what exactly this solves (it might also be the source of other subtle LSP bugs): |
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Sorry for the delay here. We have an internal infra issue where our PR import bot is unable to import this diff. Actually getting this merged got lost in the internal discussion to resolve the import issue. Let me see if I can just manually recreate the diff via copy/paste. |
Summary: There's an infra issue with the Relay repo and our PR import code which meant the automated import (D58590396) failed. This is a manual import of #4472 needed due to an infra issue on Meta's side. Full credit to tobias-tengler for the contents of this commit. Reviewed By: tyao1 Differential Revision: D59645988 fbshipit-source-id: ad252f0fa3229a9e45a8b779e4eb52ead7b5b7e8
Landed as 2b50288 |
Thanks again for this excellent PR and your patience! |
Summary: There's an infra issue with the Relay repo and our PR import code which meant the automated import (D58590396) failed. This is a manual import of facebook#4472 needed due to an infra issue on Meta's side. Full credit to tobias-tengler for the contents of this commit. Reviewed By: tyao1 Differential Revision: D59645988 fbshipit-source-id: ad252f0fa3229a9e45a8b779e4eb52ead7b5b7e8
Fixes #4472