Skip to content
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

messes up files when writing into multiple files at once with multiple formating lsp providers #58

Open
vitaly opened this issue Sep 25, 2022 · 3 comments · Fixed by pze/lsp-format.nvim#1

Comments

@vitaly
Copy link
Contributor

vitaly commented Sep 25, 2022

how to reproduce:

  • install sumneko lua-language-server
  • install stylua
  • install null-ls and enable stylua formatter
  • open about 50 lua files with, e.g. vim lua/**/*.lua
  • run bufdo w

vim will start writing into all those files and lsp-format will endup with file contents mixed between the files. e.g.
file foo will have content of file bar, which, in turn will have content of file baz etc.

@lukas-reineke
Copy link
Owner

I found some issues when writing a buffer that is not the current one, I made a PR here #59
But none of those issues would write content from one buffer into another, and I also can't reproduce that 🤔

Can you check if the PR changes anything?

@lparry
Copy link

lparry commented Dec 13, 2022

Is there a config option to not format anything except the focused buffer? I'm not sure if it's exactly the same thing as this issue, but I seem to get stuck in loops where if I save a file, every other buffer ends up with changes preventing :q, so I change buffer, :w and now every buffer is touched again. non-focused formatting just feels unhelpful

@lukas-reineke
Copy link
Owner

this is a different issue, and it should not happen.
Can you make a new ticket with steps to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants