-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot pass the settings of rust-analyer on Neovim over Neovim LSP #15
Comments
Hi, can you please enable debug logging in ra-multiplex ( |
I can't reproduce your neovim setup, you'll have to produce some logs yourself. I've found there is :LspLog command in the neovim lsp plugin, maybe you could log those while not using ra-multiplex and while using it to see the difference. My guess is either the command itself or the response to it comes as some notification without an ID and ra-multiplex can't forward those. |
Yes, I had checked LspLog at the beginning, but nothing special was found. So I think I need to intercept the incoming setting JSON message from the client to the ra-multiplex wrapper. Or it might be the problem at neovim-lsp like it does not send the message at all. |
I don't have anything useful to report (yet), but here's a "me too" comment, in that I have the exact same setup (NeoVim, Unfortunately, ra-multiplex does not seem to honour the provided configuration currently. If/when I find some more time, I'll see if I can dig up some additional logs, but at first glance, nothing relevant is being logged currently. |
Remember to add Could it be the You can see neovim receiving it and then shortly after responding with the full settings table when I disable ra-multiplex is currently you only |
I'm not sure how (or if?) it worked with coc or any other client but ignoring
This is spec compliant and what the maintainers of lsp want long term (microsoft/language-server-protocol#972) |
FWIW i got it to work by hardcoding the |
Oh I forgot to link it but I fixed it by handling workspace/configuration requests from the server |
ah great! yes that's much better :) |
We need to handle https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#workspace_configuration in some way. #26 is an option but I think we should be more deliberate about how we handle each possible server request and fix this issue handling the |
This should be fixed with #60, I'll try to recreate a neovim setup and confirm myself but if someone can verify on their own setup it'd be very helpful^^ |
Hi @pr2502! Thanks for your update. The following configuration works for me. Saying, we can either change the check behavior or modify the feature flags now. require'lspconfig'.rust_analyzer.setup {
cmd = vim.lsp.rpc.connect("127.0.0.1", 27631),
init_options = {
lspMux = {
version = "1",
method = "connect",
server = "rust-analyzer",
},
},
settings = {
["rust-analyzer"] = {
check = {
overrideCommand = {
"cargo",
"clippy",
"--message-format=json",
}
},
cargo = {
features = "all",
}
}
}
} BTW, I notice that if I need to revert the modification or change the overrideCommand back to the default "cargo check", we need to specify the value explicitly to override the previous status of ra-multiplex (if we don't shutdown the server). |
I can confirm that @YuanYuYuan's solution works on 189397d. |
Great! I'll close this now then^^ |
Hi, @pr2502 , I really appreciate your work on ra-multiplex. It seems that neovim cannot pass the settings into the rust-analyzer while using ra-multiplex. Let me give you an example. You can run
luafile ./config.lua
in neovimn to check it../config.lua
If I comment out the line
cmd = { "ra-multiplex" }
, then neovim would runcargo clippy
, which is exactly what I want. Do you have any thoughts about addressing this issue? Thanks.The text was updated successfully, but these errors were encountered: