Closed mathstuf closed 1 year ago
Seems related to this https://github.com/rust-lang/rust-analyzer/issues/6007
Some notable take-aways from that thread:
{ "rust-analyzer.server.extraEnv": { "CARGO_TARGET_DIR": "target/analyzer" } }
rust-analyzer.check.extraArgs
configuration option to use the same target directory, like: ["--target-dir=target/analyzer"]
(see rust-analyzer configuration docs for details)In ALE, the configuration would look something like this:
let g:g:ale_rust_analyzer_config = {
\ 'server': { 'extraEnv': { 'CARGO_TARGET_DIR': 'target/analyzer' } },
\ 'check': { 'extraArgs': ["--target-dir=target/analyzer"] },
\ }
Give this a try and let us know.
Ah, I missed the extra layer there. I had tried:
let g:ale_rust_analyzer_config = {
\ 'rust-analyzer.server.extraEnv': {
\ 'CARGO_TARGET_DIR': 'target/analyzer'
\ }
\}
That works, thanks. I'll see if I can improve the docs for that instead of just being "Dictionary with configuration settings for rust-analyzer.".
rust-analyzer
currently locks the default build directory. It'd be nice to be able to use a different directory to avoidcargo
commands blockingrust-analyzer
and vice versa. I've tried adding things tog:ale_rust_analyzer_config
, but I wasn't able to plumb through the--target-dir
setting.