typescript: Improve installation checks for vtsls (#20197)

This PR improves the installation checks for `vtsls`.

Previously we were checking the installed version of TypeScript against
the latest available version to determine whether we needed to installed
the `vtsls` language server or not.

However, these are two independent concerns, so we should be checking
individually whether `typescript` or `@vtsls/language-server` need to be
installed/updated.

Closes https://github.com/zed-industries/zed/issues/18349.

Release Notes:

- typescript: Fixed an issue where `@vtsls/language-server` may not have
been updated to the latest version.
This commit is contained in:
Marshall Bowers 2024-11-04 16:00:51 -05:00 committed by GitHub
parent bc4bd2e168
commit 16e9b4ceeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 20 deletions

View file

@ -161,6 +161,10 @@ impl NodeRuntime {
directory: &Path,
packages: &[(&str, &str)],
) -> Result<()> {
if packages.is_empty() {
return Ok(());
}
let packages: Vec<_> = packages
.iter()
.map(|(name, version)| format!("{name}@{version}"))