Hi! I'm a contributor to neovim's language server client implementation. I'm implementing incremental sync for neovim, and was hoping to use rust-analyzer to test whether we are sending the correct ranges. I can't seem to find in which crate the actual handler for textDocument/didChange is found (tried searching the rust-analyzer org via GH search, rust-analyzer itself, and several crates). I'd like to dump the internal representation of the buffer to a file on each change notification so that I can compare our client to what rust-analyzer believes we have sent.
You could add some logging to the console or to a file if that works for you
The changes are applied in this function https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/lsp_utils.rs#L92-L139
The entry point for
textDocument/didChange is https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/main_loop.rs#L584-L605, but there's not much happening besides
This is exactly what I was looking for! Thank you. What I did with julia language server was dump to a file, so I think that's what I'll do here. Unfortunately they don't yet support incremental sync.
Yup. Feel free to ask if you need more help (even if t it's e.g. writing to a file or compiling the code)