-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: formatting with lua-language-server rewrites the whole buffer #119
Comments
You say "the whole buffer is written, even if there's no change" and the expected behavior is "only formatted lines should have been written" So...were there formatting changes or not? Is the issue that the buffer gets set as modified after every run, even when nothing visibly changed? Does the same thing happen if you use |
I am sorry for not stating it clearly. Yes, the buffer gets set as modified, even when nothing visibly changed. And yes, the same thing happens with |
If you see the same behavior from |
I am sorry if I misunderstood, but in README, one of the features mentioned is:
That's why I filed this issue. Can you please clarify ? |
Ah, you are correct. I thought this would be happening because of the LSP sending some small no-op TextEdit on save, but yes it was replacing the entire buffer. The TextEdit was in a slightly different format from the other bad-behaving language server that I tested against, so we didn't catch it. I've updated the logic and it should work as expected now. |
Neovim version (nvim -v)
0.9.2
Operating system/version
arch linux
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
17:45:28[DEBUG] Running LSP formatter on /home/rawal/.config/nvim/lua/user/plugins.lua
17:45:32[DEBUG] Running LSP formatter on /home/rawal/.config/nvim/lua/user/plugins.lua
Describe the bug
same
Steps To Reproduce
Expected Behavior
only formatted lines should have been written
Minimal example file
No response
Minimal init.lua
Additional context
this issue does not happen with clangd
The text was updated successfully, but these errors were encountered: