This happens in several LSPs (I’ve seen volar and rust-analyzer so far) and not in every file… I use a project that is checked out windows-style and committed unix-style with Git on Windows, and this seems to only happen with certain files.
Once I format once, formatting again garbles the file’s text and duplicates lines, so somehting’s definitely wrong…
The problem is that this for me happens on save so unless I :noautocmd w this doesn’t help… Should I open an issue for this? It seems like this should be somehow handled on the lsp side…
Open an issue, using the minimal config from lspconfig on the neovim/neovim repo. I need a minimal reproduction. That means minimal config, the language server (and version) that cause the issue, and the specific file (preferably a small file) pre and post formatting (preferably all in a github repo).