languages: Allow using locally installed ty for Python (#45193)

Release Notes:

- Allow using locally installed `ty` for Python
This commit is contained in:
Henry Chu authored and GitHub committed 2025-12-18 12:54:34 +01:00
1 parent b98e9931d8
commit 6898bcbe87
1 file changed
+17
+17
View File
@@ -295,6 +295,23 @@ impl LspInstaller for TyLspAdapter {
})
}
async fn check_if_user_installed(
&self,
delegate: &dyn LspAdapterDelegate,
_: Option<Toolchain>,
_: &AsyncApp,
) -> Option<LanguageServerBinary> {
let Some(ty_bin) = delegate.which(Self::SERVER_NAME.as_ref()).await else {
return None;
};
let env = delegate.shell_env().await;
Some(LanguageServerBinary {
path: ty_bin,
env: Some(env),
arguments: vec!["server".into()],
})
}
async fn fetch_server_binary(
&self,
latest_version: Self::BinaryVersion,