Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

rust: Lookup rust-analyzer on PATH by default (#17885)

Thorsten Ball2c9d07663a7b
diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs
index a32b4f55da1..20e6c575749 100644
--- a/crates/languages/src/rust.rs
+++ b/crates/languages/src/rust.rs
@@ -57,12 +57,13 @@ impl LspAdapter for RustLspAdapter {
}
(Some(path.into()), None)
}
- (None, Some(true)) => {
+ (None, Some(true)) | (None, None) => {
+ // Try to lookup rust-analyzer in PATH by default.
let path = delegate.which(Self::SERVER_NAME.as_ref()).await?;
let env = delegate.shell_env().await;
(Some(path), Some(env))
}
- (None, Some(false)) | (None, None) => (None, None),
+ (None, Some(false)) => (None, None),
};
path.map(|path| LanguageServerBinary {
path,