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:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user