Skip to content
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

Error running with VsCode #84

Open
Flaxoos opened this issue Nov 14, 2024 · 2 comments
Open

Error running with VsCode #84

Flaxoos opened this issue Nov 14, 2024 · 2 comments

Comments

@Flaxoos
Copy link

Flaxoos commented Nov 14, 2024

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
Copy link

snoweuph commented Nov 18, 2024

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/[email protected]/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 = []

@sasa-tomic
Copy link

Quite inconveniently... you have to add rust-analyzer for every toolchain you use, e.g.:

rustup component add rust-analyzer --toolchain stable-x86_64-unknown-linux-gnu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants