-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix no inlay hints / unresolved tokens until manual edit to refresh #5693
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
No we return ContentModified during the workspace loading. This signifies the language client to retry the operation (i.e. the client will continue polling the server while it returns ContentModified). I believe that there might be cases of overly big projects where the backoff logic we have setup in `sendRequestWithRetry` (which we use for inlay hints) might bail too early (currently the largest retry standby time is 10 seconds). However, I've tried on one of my project with 500+ dependencies and it is still enough.
I think this approach makes sense! Do we need to let exit/shutdown go through? I haven't looked too closely at it. |
My understanding is that the I wouldn't be surprised if some clients will have problems with |
During The |
Ah, I see |
Yup, I tried returning ServerNotInitialized at the same place I've put ContentModified and the language client just considered this an unrecoverable error. |
That makes sense since we've already processed the
At this point in the code the LSP client considers us initialized. The spec makes no mention of the expected behavior (as in "what does initialization really mean?"). I think your solution to return |
I've added a condition to let |
6144784
to
f4833cb
Compare
Hmm, is this a bug with |
Does |
f4833cb
to
dbe7ede
Compare
Nvm, that's tripple equals what makes cargo fmt wild... |
Relevant :) rust-lang/rust#75321 |
Lol, what a coincidence :D |
Yeah I think that should be a separate PR. |
bors r+ |
5696: Return InvalidRequest if Shutdown has been requested r=kjeremy a=kjeremy From the LSP 3.16 spec: "If a server receives requests after a shutdown request those requests should error with InvalidRequest." Realized this behavior was missing while looking at #5693. Question on notification behavior is tracked at microsoft/language-server-protocol#1066 Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Fixes #5349
Now we return ContentModified during the workspace loading. This signifies the language
client to retry the operation (i.e. the client will
continue polling the server while it returns ContentModified).
I believe that there might be cases of overly big projects where the backoff
logic we have setup in
sendRequestWithRetry
(which we use for inlay hints)might bail too early (currently the largest retry standby time is 10 seconds).
However, I've tried on one of my project with 500+ dependencies and it is still enough.
Here are the examples before/after the change (the gifs are quite lengthy because they show testing rather large cargo workspace).
Before
Here you can see that the client receives empty array of inlay hints and does nothing more.
Same applies to semantic tokens. The client receives unresolved tokens and does nothing more.
The user needs to do a manual edit to refresh the editor.
After
Here the server returns ContentModified, so the client periodically retries the requests and eventually receives the wellformed response.