diff options
author | runiq <patrice.peterson@mailbox.org> | 2022-04-20 18:40:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 18:40:52 +0200 |
commit | 7e7fdca163b10f8141c72936cea82051843c83c6 (patch) | |
tree | cab6e1491530c2bacbccff42b4df9118f7ae70c9 /runtime/lua/vim/lsp/util.lua | |
parent | 6b0d3ae6a83cb0410c16532a367ed8ad9bd093a8 (diff) | |
download | rneovim-7e7fdca163b10f8141c72936cea82051843c83c6.tar.gz rneovim-7e7fdca163b10f8141c72936cea82051843c83c6.tar.bz2 rneovim-7e7fdca163b10f8141c72936cea82051843c83c6.zip |
fix(lsp): unify progress message handling (#18040)
The LSP progress handler would put non-progress messages (such as from
clangd or pyls; not part of the LSP spec) directly into
`client.messages`, while `vim.lsp.util.get_progress_messages()` would
try to fetch them from `client.messages.messages` instead (and come up
empty everytime). This would result in these messages never being
cleaned up by `get_progress_messages()`.
This commit fixes that by treating those messages like show-once
progress messages (by setting `done=true` immediately).
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 30587afb38..1f1a34b04a 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -302,7 +302,6 @@ end function M.get_progress_messages() local new_messages = {} - local msg_remove = {} local progress_remove = {} for _, client in ipairs(vim.lsp.get_active_clients()) do @@ -325,29 +324,6 @@ function M.get_progress_messages() end end - for i, msg in ipairs(data.messages) do - if msg.show_once then - msg.shown = msg.shown + 1 - if msg.shown > 1 then - table.insert(msg_remove, {client = client, idx = i}) - end - end - - table.insert(new_messages, {name = data.name, content = msg.content}) - end - - if next(data.status) ~= nil then - table.insert(new_messages, { - name = data.name, - content = data.status.content, - uri = data.status.uri, - status = true - }) - end - for _, item in ipairs(msg_remove) do - table.remove(client.messages, item.idx) - end - end for _, item in ipairs(progress_remove) do |