pr2502 / ra-multiplex

share one rust-analyzer server instance between multiple LSP clients to save resources
MIT License
390 stars 29 forks source link

Error running with VsCode #84

Open Flaxoos opened 4 days ago

Flaxoos commented 4 days ago

vscode settings:

{
    "rust-analyzer.server.path": "/Users/me/.cargo/bin/ra-multiplex",
}

running ra multiplex server

/Users/me/.cargo/bin/ra-multiplex server
 INFO cannot load config file, continuing with defaults err=cannot read config file `/Users/me/Library/Application Support/ra-multiplex/config.toml`

Caused by:
    No such file or directory (os error 2)
 INFO listening socket=Tcp(127.0.0.1, 27631)
 -- after connecting vscode, below output---
INFO instance{pid=22726}: spawned language server server="rust-analyzer" args=[] cwd="/path/to/project"
ERROR instance{pid=22726}: stderr line=error: Unknown binary 'rust-analyzer' in official toolchain 'nightly-aarch64-apple-darwin'.
ERROR client{client_id=0}: client error: spawning instance

Caused by:
    0: server handshake
    1: stream ended

Please help :(

snoweuph commented 23 hours ago

Same error for me, when Nvim Attaches

> ra-multiplex server
 INFO listening socket=Tcp(127.0.0.1, 27631)
 INFO client{client_id=0}: client connected
 INFO instance{pid=173955}: spawned language server server="rust-analyzer" args=[] cwd="/home/dominik.saeume@hmmh.ag/Workspace/hmmh/report-book-generator"
ERROR instance{pid=173955}: stderr line=error: Unknown binary 'rust-analyzer' in official toolchain 'stable-x86_64-unknown-linux-gnu'.
ERROR client{client_id=0}: client error: spawning instance

Caused by:
    0: server handshake
    1: stream ended

nvim config:

lspconfig.rust_analyzer.setup({
            cmd = { "ra-multiplex" },
            settings = {
                ["rust-analyzer"] = {
                    check = {
                        overrideCommand = {
                            "cargo",
                            "clippy",
                            "--message-format=json-diagnostic-rendered-ansi",
                            "--fix",
                            "--allow-dirty"
                        }
                    }
                }
            }
        })

ra-multiplex config

instance_timeout = 300 # after 5 minutes
gc_interval = 10 # every 10 seconds
listen = ["127.0.0.1", 27631] # localhost & some random unprivileged port
connect = ["127.0.0.1", 27631] # same as `listen`
log_filters = "info"
pass_environment = []