Skip to content

Commit 8fa438f

Browse files
committed
fix: keep LSP attached and auto-save buffers after LSP rename operations
1 parent dd032ee commit 8fa438f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/flutter-tools/lsp/rename.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ function M.rename(new_name, opts)
6868
params.newName = name
6969
local handler = client.handlers["textDocument/rename"] or lsp.handlers["textDocument/rename"]
7070
client.request("textDocument/rename", params, function(...)
71-
if result then lsp.util.apply_workspace_edit(result, client.offset_encoding) end
7271
handler(...)
72+
if result then lsp.util.apply_workspace_edit(result, client.offset_encoding) end
73+
74+
-- Save all modified buffers after applying workspace edits
75+
vim.cmd("silent! wa")
7376
end, bufnr)
7477
end
7578

0 commit comments

Comments
 (0)