prabirshrestha / vim-lsp

async language server protocol plugin for vim and neovim
MIT License
3.1k stars 304 forks source link

Text edits with the same start position are applied in reverse #1566

Closed kyoh86 closed 1 month ago

kyoh86 commented 1 month ago

Text edits returned from the LSP that have the same start position are being applied in reverse. According to the spec, text edits with the same start position should be applied in the order received.

Recently, the language server client included with Neovim has fixed this bug (https://github.com/neovim/neovim/issues/29202)

Accordingly, using some servers (e.g. efm-langserver) with the client included with Neovim, the formatted lines of the result may be reversed. So I tried to ask the server to fix it (https://github.com/mattn/efm-langserver/issues/281), but the fix causes problems with other (non-specified) clients such as coc.nvim. Therefore, I would like you to implement a fix in coc.nvim that follows the spec, as well as Neovim.

kyoh86 commented 1 month ago

I'm having quite a bit of trouble, can anyone at least give me the maintainer's opinion?

kyoh86 commented 1 month ago

It has fixed in Neovim.