gleam: Don't cache user-installed gleam
(#10635)
This PR updates the Gleam extension to not cache the binary when it is using the one on the $PATH. Release Notes: - N/A
This commit is contained in:
parent
210f8ebfed
commit
53105ddd16
1 changed files with 4 additions and 5 deletions
|
@ -13,17 +13,16 @@ impl GleamExtension {
|
|||
language_server_id: &LanguageServerId,
|
||||
worktree: &zed::Worktree,
|
||||
) -> Result<String> {
|
||||
if let Some(path) = worktree.which("gleam") {
|
||||
return Ok(path);
|
||||
}
|
||||
|
||||
if let Some(path) = &self.cached_binary_path {
|
||||
if fs::metadata(path).map_or(false, |stat| stat.is_file()) {
|
||||
return Ok(path.clone());
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(path) = worktree.which("gleam") {
|
||||
self.cached_binary_path = Some(path.clone());
|
||||
return Ok(path);
|
||||
}
|
||||
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue