From ee3a58d42e7fce666eef570db6f2944c29303d98 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Sun, 14 Nov 2021 12:55:16 +0100 Subject: 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. --- test/functional/plugin/lsp_spec.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index ae7612ab08..228fc06e9b 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -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) -- cgit