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
Missing work done progress token
from client init
#27938
Comments
work done progress token
from client init
should this be a config parameter for each language server, or should Neovim always create the progress token itself? Are there downsides to creating / not creating the token as the client? |
Hello @rudiejd From what i saw, when the server creates it by itself this creates no effect on the expected behavior. But for the ones where this is expected this change will enables to fully work. Since this is expected based on the specification for LSP in general, i don't believe it should be for each language server, but a implementation for the protocol itself. VSCode for example always send a generated UUID in the init call. Emacs in the other hand just send a fixed string "1". Bottom line is, receive this parameter is already expected from the LSPs since it's part of the specification. Some servers will ignore it and others will use the received one. So theres no real downside in this. |
Thank you for the detailed response! I noticed VSCode makes this configurable, so I chose to make it configurable just in case. I'm not sure if there are any benefits of sending a UUID, so I just sent "1" for now similar to emacs. Let me know if my branch works for you |
@rudiejd Thanks for doing this implementation, after taking a fast look it looks pretty much ok to me. Right now i'm also working with a fixed string in my local build, and it's just fine, so i believe sending fixed "1" as emacs will be the best choice. |
Problem: Some servers don't report progress during initialize unless the client sets the `workDoneToken` See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress In particular: > There is no specific client capability signaling whether a client will > send a progress token per request. The reason for this is that this is > in many clients not a static aspect and might even change for every > request instance for the same request type. So the capability is signal > on every request instance by the presence of a workDoneToken property. And: > Servers can also initiate progress reporting using the > window/workDoneProgress/create request. This is useful if the server > needs to report progress outside of a request (for example the server > needs to re-index a database). The token can then be used to report > progress using the same notifications used as for client initiated > progress. So far progress report functionality was relying entirely on the latter. Solution: Set a `workDoneToken` Closes neovim#27938
Problem: Some servers don't report progress during initialize unless the client sets the `workDoneToken` See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress In particular: > There is no specific client capability signaling whether a client will > send a progress token per request. The reason for this is that this is > in many clients not a static aspect and might even change for every > request instance for the same request type. So the capability is signal > on every request instance by the presence of a workDoneToken property. And: > Servers can also initiate progress reporting using the > window/workDoneProgress/create request. This is useful if the server > needs to report progress outside of a request (for example the server > needs to re-index a database). The token can then be used to report > progress using the same notifications used as for client initiated > progress. So far progress report functionality was relying entirely on the latter. Solution: Set a `workDoneToken` Closes #27938
Problem
Right now,
clojure-lsp
relies on the microsoft lsp specification that delegates theWork Done progress token
creation to the sender.https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress
The problem is their implementation ignores the
$/progress
publication when this is not present, this way nonelsp-status
tool works correctly to give to user feedback, what is bad since we don't really know when the processing is finished and can take a while.Others LSP (luals, golsp, etc...) just sets a random value
(string | int)
when it's not present and everything is working.But in this case (maybe other LSP also relies in this definitions) it's just is ignored.
To resolve this, in my local neovim build updated the
function Client:initialize()
implementation to also sent the propertyworkDoneToken = "foobar"
inside theinitialize_params
. Since this is the same approach used byvscode
andemacs
.After this change the
$/progress
starts to receive every progress update, thuslsp-status
andfidget
was working just fine.Steps to reproduce using "nvim -u minimal_init.lua"
Expected behavior
should contains the
$/progress
in the lsp debug logsNeovim version (nvim -v)
Nvim 0.9.5
Language server name/version
clojure-lsp/2024.02.01-11.01.59
Operating system/version
macos/14.2.1 (sonoma)
Log file
No response
The text was updated successfully, but these errors were encountered: