Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
vtsls: Remove redundant TypeScript installation (#60951)
Smit Barmasee06d4b2b9f03
diff --git a/crates/languages/src/vtsls.rs b/crates/languages/src/vtsls.rsindex acf8aea5e59..426f09d6c94 100644--- a/crates/languages/src/vtsls.rs+++ b/crates/languages/src/vtsls.rs@@ -39,7 +39,6 @@ impl VtslsLspAdapter {const PACKAGE_NAME: &'static str = "@vtsls/language-server";const SERVER_PATH: &'static str = "node_modules/@vtsls/language-server/bin/vtsls.js";- const TYPESCRIPT_PACKAGE_NAME: &'static str = "typescript";const TYPESCRIPT_TSDK_PATH: &'static str = "node_modules/typescript/lib";const TYPESCRIPT_YARN_TSDK_PATH: &'static str = ".yarn/sdks/typescript/lib";@@ -84,15 +83,10 @@ impl VtslsLspAdapter {}}-pub struct TypeScriptVersions {- typescript_version: Version,- server_version: Version,-}-const SERVER_NAME: LanguageServerName = LanguageServerName::new_static("vtsls");impl LspInstaller for VtslsLspAdapter {- type BinaryVersion = TypeScriptVersions;+ type BinaryVersion = Version;async fn fetch_latest_server_version(&self,@@ -100,13 +94,9 @@ impl LspInstaller for VtslsLspAdapter {_: bool,_: &mut AsyncApp,) -> Result<Self::BinaryVersion> {- Ok(TypeScriptVersions {- typescript_version: self.node.npm_package_latest_version("typescript").await?,- server_version: self- .node- .npm_package_latest_version("@vtsls/language-server")- .await?,- })+ self.node+ .npm_package_latest_version(Self::PACKAGE_NAME)+ .await}async fn check_if_user_installed(@@ -135,11 +125,8 @@ impl LspInstaller for VtslsLspAdapter {async move {let server_path = container_dir.join(Self::SERVER_PATH);- node.npm_install_latest_packages(- &container_dir,- &[Self::PACKAGE_NAME, Self::TYPESCRIPT_PACKAGE_NAME],- )- .await?;+ node.npm_install_latest_packages(&container_dir, &[Self::PACKAGE_NAME])+ .await?;Ok(LanguageServerBinary {path: node.binary_path().await?,@@ -156,8 +143,7 @@ impl LspInstaller for VtslsLspAdapter {_: &Arc<dyn LspAdapterDelegate>,) -> impl Send + Future<Output = Option<LanguageServerBinary>> + use<> {let node = self.node.clone();- let typescript_version = version.typescript_version.clone();- let server_version = version.server_version.clone();+ let server_version = version.clone();let container_dir = container_dir.clone();async move {@@ -175,18 +161,6 @@ impl LspInstaller for VtslsLspAdapter {return None;}- if node- .should_install_npm_package(- Self::TYPESCRIPT_PACKAGE_NAME,- &container_dir.join(Self::TYPESCRIPT_TSDK_PATH),- &container_dir,- VersionStrategy::Latest(&typescript_version),- )- .await- {- return None;- }-Some(LanguageServerBinary {path: node.binary_path().await.ok()?,env: None,