mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(lsp): ensure buffers are re-attached on rename (#16266)
If a LSP server sent a workspace edit containing a rename the buffers file name changed without the server receiving a close notification for the old buffer and without the client properly re-attaching on the new file. This affected `Move` code-actions in nvim-jdtls, but also `vim.lsp.buf.rename` on a class level.
This commit is contained in:
committed by
GitHub
parent
2ef9d2a663
commit
ee3a58d42e
@@ -1735,6 +1735,7 @@ describe('LSP', function()
|
||||
|
||||
-- after rename the target file must have the contents of the source file
|
||||
local bufnr = vim.fn.bufadd(new)
|
||||
vim.fn.bufload(new)
|
||||
return vim.api.nvim_buf_get_lines(bufnr, 0, -1, true)
|
||||
]], old, new)
|
||||
eq({'Test content'}, lines)
|
||||
|
||||
Reference in New Issue
Block a user