-
Notifications
You must be signed in to change notification settings - Fork 793
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
Possibly misleading statement about Message ordering #1693
Comments
Because the rename could change the result of the definition request. So if you first execute the rename although the definition request was executed on a different document version the result might be incorrect. Hope that explains it. |
How is it possible that a rename request alters how the a request after it like definition or references should be handled?
As an example, if you use the "Rename Symbol" feature in VS-Code it will send a rename request followed by a didChange. If there is no request that modifies a document like didChange is inbetween a references and rename request, they are both performed on the same document version. Whether or not the rename or references request comes first, shouldn't matter. Therefore, reordering or executing them in parallel should not pose a problem. |
If the rename request sends it result first the client might apply the changes but the server still computes the definitions on an older state hence the client might use results that are off. |
Isn't this scenario achievable regardless of using message reordering. If a client send a sends a references request and then a didChange request and receives its responses in order (references first). The result has been computed before the didChange request and from the perspective of the client, the results are off because it has already modified that document in a previous request. And also, does this only apply to the rename request? Can i reorder references, completion, semantic token, workspace symbol requests or similar if i don't change any state in between (e.g. with didChange) but not a rename request? Just to make sure, whenever I talk about the rename request, i only mean sending a textDocument/rename without using its result. No document got modified. |
Yes, but the client knows about this and can act accordingly. For example by canceling the first request. If the client doesn't use the result of the rename request then it would be fine to use the definition result. |
Does the rename or references request modify any state, document or may otherwise have any observable behavior and if so what exactly? |
The Specification has the following to say about Message ordering:
I understand that a completion and signature request do not affect each other, but why doesn't the same apply to a definition and rename request? This seems to suggest that a rename request orders the server to compute and apply a rename. Usually this request is followed by a didChange that actually performs the edit.
The text was updated successfully, but these errors were encountered: