[clangd] Heuristic to avoid desync if editors are confused about newline-at-eof
As strange as it seems to our files-are-strings view of the world, some editors that treat files as arrays of lines can get confused about whether the last line has a newline or not. The consequences of failing to handle a bad incremental update are catastrophic. If an update would be valid except for a missing newline at end of file, pretend one exists. This fixes problems still present in neovim where deleting all text often leads to a desync shortly afterwards: https://github.com/neovim/neovim/issues/17085 Differential Revision: https://reviews.llvm.org/D135508
Loading
Please sign in to comment