diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2024-04-05 13:24:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 13:24:39 +0200 |
commit | 9af355964306977eab836ca5324ed70d685c0c8e (patch) | |
tree | 05dd7d255b0411128662043c83287ef68bb62fb6 /runtime/lua/vim/lsp/client.lua | |
parent | 6ecb5d2d0c96d5f18d9dd8f3568c1fe3bfdca903 (diff) | |
download | rneovim-9af355964306977eab836ca5324ed70d685c0c8e.tar.gz rneovim-9af355964306977eab836ca5324ed70d685c0c8e.tar.bz2 rneovim-9af355964306977eab836ca5324ed70d685c0c8e.zip |
feat(lsp): set workDoneToken in initialize request (#28182)
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 https://github.com/neovim/neovim/issues/27938
Diffstat (limited to 'runtime/lua/vim/lsp/client.lua')
-rw-r--r-- | runtime/lua/vim/lsp/client.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua index f73f97b8cd..09064b9510 100644 --- a/runtime/lua/vim/lsp/client.lua +++ b/runtime/lua/vim/lsp/client.lua @@ -579,6 +579,7 @@ function Client:initialize() initializationOptions = config.init_options, capabilities = self.capabilities, trace = self._trace, + workDoneToken = '1', } self:_run_callbacks( |