mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 03:58:32 +00:00

Overriding vim.lsp.handlers['textDocument/formatting'] doesn't work here because fake_lsp_server_setup() uses a table with __index to specify client handlers, which takes priority over vim.lsp.handlers[], and as a result the overridden handler is never called, and the test ends before the vim.wait() even finishes. Instead, set a global variable from the handler that is actually reached (by vim.rpcrequest() from client handler), and avoid stopping the event loop too early.