-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
lsp: incorrect symbol positions #10437
Comments
@kitsonk Author of |
Yeah, reading that issue, I could see how it is "easy" to run into bugs like that. We have also had some dead-locking issues which are likely related to this space as well, which have made us have to worry about more of our locking mechanisms when processing things on different threads. I will look at the issue in more detail and provide some thoughts feedback. Thanks for reaching out. |
No worries! I think that gathering feedback and recounting real-world experiences from framework users and language server implementers would be very valuable here. It would help us determine whether concurrent execution really contributes to these classes of bugs, and if so, we can restructure |
Release v0.16.0 of However, this would be a pretty brute-force solution. If concurrent request handling is still desirable, versioning the document data and discarding outdated information, as suggested in the original ticket description, would be much more palatable. Hopefully making progress on ebkalderon/tower-lsp#284 will improve things further. |
We account for versions and have cancellations for lsp/tsc now. |
I noticed when editing documents, sometimes in larger documents, I started to see "incorrect" symbol positions in the editor. I believe this is because of the async nature of the language server, but the sync nature of tsc. I believe the symbols were starting to be calculated while additional text edits were occurring in the document, which resulted in the response positions for the symbols being off a few positions.
What we need to do is the version of the document before we go into tsc and then discard the results from tsc if the version of the document has changed, and re-run again with the new version until we get a matching pre and post versions. I guess we should also check into the cancellation API as well.
The text was updated successfully, but these errors were encountered: