diff options
author | jdrouhard <john@drouhard.dev> | 2023-05-30 13:56:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 20:56:29 +0200 |
commit | 58618d208acd3827c4e86668529edb619bb9b8dd (patch) | |
tree | 75db1fedc9913070752f4e1abaac394097934b6d /src | |
parent | dd3fa645735539c75b72dc1b0114278b5fa57f7f (diff) | |
download | rneovim-58618d208acd3827c4e86668529edb619bb9b8dd.tar.gz rneovim-58618d208acd3827c4e86668529edb619bb9b8dd.tar.bz2 rneovim-58618d208acd3827c4e86668529edb619bb9b8dd.zip |
feat(lsp)!: promote LspRequest to a full autocmd and enrich with additional data (#23694)
BREAKING CHANGE: LspRequest is no longer a User autocmd but is now a
first class citizen.
LspRequest as a User autocmd had limited functionality. Namely, the only
thing you could do was use the notification to do a lookup on all the
clients' requests tables to figure out what changed.
Promoting the autocmd to a full autocmd lets us set the buffer the
request was initiated on (so people can set buffer-local autocmds for
listening to these events).
Additionally, when used from Lua, we can pass additional metadata about
the request along with the notification, including the client ID, the
request ID, and the actual request object stored on the client's
requests table. Users can now listen for these events and act on them
proactively instead of polling all of the requests tables and looking
for changes.
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 aef08be820..048b8d6631 100644 --- a/src/nvim/auevents.lua +++ b/src/nvim/auevents.lua @@ -72,6 +72,7 @@ return { 'InsertLeavePre', -- just before leaving Insert mode 'LspAttach', -- after an LSP client attaches to a buffer '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 'MenuPopup', -- just before popup menu is displayed 'ModeChanged', -- after changing the mode @@ -152,6 +153,7 @@ return { DiagnosticChanged=true, LspAttach=true, LspDetach=true, + LspRequest=true, LspTokenUpdate=true, RecordingEnter=true, RecordingLeave=true, |