Implement a more robust way of locating rust-analyzer

When bundled, we will retrieve it out of the `Resources` folder.
Locally, we're expected to run `script/download-rust-analyzer` and
put `vendor/bin` in our $PATH.
This commit is contained in:
Antonio Scandurra
2021-10-25 11:02:35 +02:00
parent 715faaaceb
commit 59ed535cdf
13 changed files with 97 additions and 52 deletions
+3 -7
View File
@@ -49,7 +49,7 @@ impl Project {
languages: Arc<LanguageRegistry>,
rpc: Arc<Client>,
fs: Arc<dyn Fs>,
background: &executor::Background,
cx: &AppContext,
) -> Self {
Self {
worktrees: Default::default(),
@@ -57,11 +57,7 @@ impl Project {
languages,
client: rpc,
fs,
language_server: LanguageServer::new(
Path::new("/Users/as-cii/Downloads/rust-analyzer-x86_64-apple-darwin"),
background,
)
.unwrap(),
language_server: LanguageServer::rust(cx).unwrap(),
}
}
@@ -420,6 +416,6 @@ mod tests {
let languages = Arc::new(LanguageRegistry::new());
let fs = Arc::new(RealFs);
let rpc = client::Client::new();
cx.add_model(|cx| Project::new(languages, rpc, fs, cx.background()))
cx.add_model(|cx| Project::new(languages, rpc, fs, cx))
}
}