aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/range.lua
diff options
context:
space:
mode:
authorjdrouhard <john@drouhard.dev>2026-07-15 06:07:17 -0500
committerGitHub <noreply@github.com>2026-07-15 07:07:17 -0400
commit44d5593afd5e16f8c673ceeed2813967550b3415 (patch)
tree8fd1d600df0b81706713defc0eb03cfe5d77c7ab /runtime/lua/vim/range.lua
parent4bc30d6e1024788c6acf54cf3e4a98618123482e (diff)
downloadrneovim-44d5593afd5e16f8c673ceeed2813967550b3415.tar.gz
rneovim-44d5593afd5e16f8c673ceeed2813967550b3415.tar.bz2
rneovim-44d5593afd5e16f8c673ceeed2813967550b3415.zip
refactor(lsp): unify LspNotify, decor provider for capabilities #40691
Problem: Every LSP capability that sends a request on a document change to update its state was using its own buffer-local autocmd to do so. That means there is a separate autocmd per buffer per active capability/feature, and the actual code inside the autocmd callback was virtually identical. The same problem occurred for capabilities that had components to draw on the screen that had their own decoration providers. Solution: Introduce a central `LspNotify` autocmd and decoration provider in the capability module itself. New base class methods `on_close` and `on_change` that take a client_id have been provided, for `didClose` and `didOpen`/`didChange` notifications respectively. New base class method `on_win` that takes topline and botline has been provided to add extmarks or perform other work when lines of a buffer are being drawn. The autocmd callback loops through each active capability instance for the buffer and calls a corresponding method with the triggering client_id if it is currently attached to the buffer that triggered the autocmd. The decoration provider just calls on_win for all active capabilities on the buffer. This slightly tweaks folding range to make use of these new client-id specific callbacks.
Diffstat (limited to 'runtime/lua/vim/range.lua')
0 files changed, 0 insertions, 0 deletions