mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #14264 from mjlbach/feature/handle_reloading_buffer
lsp: add on_reload callback for buffer edits outside of neovim
This commit is contained in:
commit
3d25a72a60
@ -941,6 +941,15 @@ function lsp.buf_attach_client(bufnr, client_id)
|
||||
-- First time, so attach and set up stuff.
|
||||
vim.api.nvim_buf_attach(bufnr, false, {
|
||||
on_lines = text_document_did_change_handler;
|
||||
on_reload = function()
|
||||
local params = { textDocument = { uri = uri; } }
|
||||
for_each_buffer_client(bufnr, function(client, _)
|
||||
if client.resolved_capabilities.text_document_open_close then
|
||||
client.notify('textDocument/didClose', params)
|
||||
end
|
||||
text_document_did_open_handler(bufnr, client)
|
||||
end)
|
||||
end;
|
||||
on_detach = function()
|
||||
local params = { textDocument = { uri = uri; } }
|
||||
for_each_buffer_client(bufnr, function(client, _)
|
||||
|
Loading…
Reference in New Issue
Block a user