diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2023-06-09 11:32:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-09 11:32:43 +0200 |
commit | e5e0bda41b640d324350c5147b956e37e9f8b32c (patch) | |
tree | d546e647fcde46494740852171593e78101d9997 /src | |
parent | f31dba93f921891159eb707b185517648df00d6b (diff) | |
download | rneovim-e5e0bda41b640d324350c5147b956e37e9f8b32c.tar.gz rneovim-e5e0bda41b640d324350c5147b956e37e9f8b32c.tar.bz2 rneovim-e5e0bda41b640d324350c5147b956e37e9f8b32c.zip |
feat(lsp)!: add vim.lsp.status, client.progress and promote LspProgressUpdate (#23958)
`client.messages` could grow unbounded because the default handler only
added new messages, never removing them.
A user either had to consume the messages by calling
`vim.lsp.util.get_progress_messages` or by manually removing them from
`client.messages.progress`. If they didn't do that, using LSP
effectively leaked memory.
To fix this, this deprecates the `messages` property and instead adds a
`progress` ring buffer that only keeps at most 50 messages. In addition
it deprecates `vim.lsp.util.get_progress_messages` in favour of a new
`vim.lsp.status()` and also promotes the `LspProgressUpdate` user
autocmd to a regular autocmd to allow users to pattern match on the
progress kind.
Also closes https://github.com/neovim/neovim/pull/20327
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/auevents.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua index 048b8d6631..41d7ee9b47 100644 --- a/src/nvim/auevents.lua +++ b/src/nvim/auevents.lua @@ -74,6 +74,7 @@ return { 'LspDetach', -- after an LSP client detaches from a buffer 'LspRequest', -- after an LSP request is started, canceled, or completed 'LspTokenUpdate', -- after a visible LSP token is updated + 'LspProgress', -- after a LSP progress update 'MenuPopup', -- just before popup menu is displayed 'ModeChanged', -- after changing the mode 'OptionSet', -- after setting any option @@ -154,6 +155,7 @@ return { LspAttach=true, LspDetach=true, LspRequest=true, + LspProgress=true, LspTokenUpdate=true, RecordingEnter=true, RecordingLeave=true, |