How to compare logs from coc.nvim and nvim-lspconfig?

I'm trying to understand what feels like a bug in a LSP plugin in neovim because the same behavior isn't present in coc.nvim. How do I inspect rust-analyzer logs between coc.nvim and nvim-lspconfig?

Various kinds of features like going to the definition of a function, getting auto-completion results, or displaying documentation from an external crate or from the standard library do not work when I use nvim-lspconfig. All of these work with coc.nvim plus the rust-analyzer coc.nvim plugin, coc-rust-analyzer.

Good question! I think this would works best if the client (neovim) is tasked with capturing and displaying the LSP dialog. In VS Code, this is achieved by setting a "rust-analyzer.trace.server": "verbose" config value and opening a specific pane:

This question indicates that this is either not implemented or not discoverable in neovim (not that it is discoverable in code ...). I owe a cookie to the person who fixes it :slight_smile:

I personally consider this a rather high-priority thing, as debugging why a specific thing doesn't work is very annoying otherwise. I've opened https://github.com/rust-analyzer/rust-analyzer/issues/8233 to try to improve the state of the art here.

All that being said, logging lsp requests on the server side is possible by setting RA_LOG env var to lsp_server=debug. The log go to stderr by default. --log-file argument redirects the logs to file. Docs:
https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/README.md#logging

2 Likes

While I did not figure out how to see the logs for this, my issue went away when I reinstalled rust-analyzer from source so I moved on :laughing:

Thanks for filing the issue!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.