simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.17k stars 158 forks source link

where to configure the path of rust-analyzer? #265

Closed vimalk78 closed 1 year ago

vimalk78 commented 1 year ago

I plan to use https://github.com/pr2502/ra-multiplex/, since it can keep rust-analyzer runing in the background.

So i need to change the path of the executable used by this plugin.

i want rust-tools to use ra-multiplex instead of rust-analyzer directly.

where do i change it?

korsmakolnikov commented 1 year ago

up +

blkgoose commented 1 year ago

I've looked around the code, one can change the cmd as such:

    use {
        'simrat39/rust-tools.nvim',
        config = function()
            require('rust-tools').setup {
                server = {
                    cmd = { "ra-multiplex" }
                }
            }
        end,
    }

This won't work though, ra-multiplex will give an error saying duplicate DidOpenTextDocument, thus the issue cannot be resolved here but only on neovim's internal LSP.

xbladesub commented 1 year ago

same problem. How to specify path? I used rustup to install rust-analyzer

xbladesub commented 1 year ago

in my case it worked with

    server = {
        cmd = { "/Users/nshv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rust-analyzer" },
simrat39 commented 1 year ago

Put it in config.server.cmd and make sure you're not setting up rust analyzer separately through lspconfig as rust-tools already does that