diff options
author | Bruce Weirdan <weirdan@gmail.com> | 2023-07-24 19:26:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 19:26:17 +0200 |
commit | 966eb8e0b3be1b409e491d5cf1e32e82e806a134 (patch) | |
tree | f3e4b64fc68bb4cd17f5b5a8b2c9ae27668ec3c4 | |
parent | a37d568082ad2a6fd479bc0584f1088b51019b7f (diff) | |
download | rneovim-966eb8e0b3be1b409e491d5cf1e32e82e806a134.tar.gz rneovim-966eb8e0b3be1b409e491d5cf1e32e82e806a134.tar.bz2 rneovim-966eb8e0b3be1b409e491d5cf1e32e82e806a134.zip |
fix(lsp): announce publishDiagnostics.dataSupport (#24442)
Neovim already passed `data` element from published diagnostic to code action, but failed to announce it in client capabilities.
Here is the test that shows that `data` element is returned by `vim.lsp.diagnostic.get_line_diagnostics()`:
https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/test/functional/plugin/lsp/diagnostic_spec.lua#L103-L115
and then `get_line_diagnostics()` is used to construct the context for code action request:
https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/runtime/lua/vim/lsp/buf.lua#L742
-rw-r--r-- | runtime/lua/vim/lsp/protocol.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 537a5eda39..31cc071d18 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -828,6 +828,7 @@ function protocol.make_client_capabilities() return res end)(), }, + dataSupport = true, }, callHierarchy = { dynamicRegistration = false, |