When I rename a symbol via eglot-rename in emacs, lsp dutifully renames the symbol in the current buffer as well as other files that use this symbol.
However, it doesn't write the buffers back to the files! So when I write the current file, my tests fail because the other files haven't been written yet. I end up hunting in my *buffers* for unsaved buffers and save them to complete the refactoring.
That doesn't seem efficient. What's the intended workflow here?
I use projectile-save-project-buffers, but that seems like a useful hook!
@ericdallo Are you sure you need the lambda? Why not just #'save-buffer? (With use-package, :hook (lsp-after-apply-edits . save-buffer seems to work).
yeah, probably will work, I added that code 5 years ago when my elisp-fu was quite bad ๐
You could use save-some-buffers (`C-x s`).
yes, this is a client responsibility, I use this hook with lsp-mode:
(add-hook 'lsp-after-apply-edits-hook (lambda (&rest _) (save-buffer)))