Skip to content
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

Error autocompleting if document changes in-flight #8

Open
radeksimko opened this issue Feb 21, 2020 · 2 comments
Open

Error autocompleting if document changes in-flight #8

radeksimko opened this issue Feb 21, 2020 · 2 comments

Comments

@radeksimko
Copy link
Member

radeksimko commented Feb 21, 2020

Per LSP spec:

if a server detects a state change that invalidates the result of a request in execution the server can error these requests with ContentModified. If clients receive a ContentModified error, it generally should not show it in the UI for the end-user. Clients can resend the request if appropriate.

We might be able to leverage document versions and compare versions and the beginning and before the end of completion handler.

This is especially important when completing because the operation may be expensive and time-consuming. Getting github schema from Terraform can take around 1sec and could take much more for bigger providers, so the user (or anything outside of the editor) may continue modifying the document in the meantime which then invalidates the list of completion candidates.


Resolving this will also allow us to block responding to a completion or formatting request until loading for the relevant root module is finished as per #218

@danieldreier
Copy link
Contributor

@radeksimko am I understanding right that this is effectively blocked on #426 because with concurrency = 1 ContentModified would only be processed after the autocomplete is returned?

@radeksimko
Copy link
Member Author

@danieldreier That is right, but fix is coming 🔜 - #489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants