Installing suggested extension always pulls latest, potentially incompatible version of extension
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
When opening file types for languages that come with recommended extension (ex: Gleam in this case) and proceeding to install the extension recommended by Zed, it seems that it always installs the latest version which may potentially be incompatible with the current (stable) release of the editor.
For context it looks like #9938 introduced the ability to disable incompatible extensions in the extensions view, so in Gleam's case one won't be able to manually install the latest 0.1.0 version (which is incompatible with the current Zed stable release) from the extenstions view.
However when installing it via Zed's suggested extension popup, it pulls that latest version by default which results in a broken experience (syntax highlighting works but LSP crashes). Manually downgrading to compatible version of extension fixes the issue. Another minor bug I picked up is that downgrading does not update the displayed version number in the extension view (still says 0.1.0 when installed version is 0.0.2). It would also be nice to visually indicate which version is currently installed in the versions selection panel.
Here's a GIF of the issue
CC @maxdeviant who seems to be driving these extension upgrades (great work btw!)
Environment
Zed: v0.130.6 (Zed)
OS: macOS 14.4.1
Memory: 8 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
relevant extension crash log when the incompatible version is installed
2024-04-12T19:01:48+02:00 [INFO] installing extension gleam latest version
2024-04-12T19:01:50+02:00 [INFO] rebuilt extension index in 24.939875ms
2024-04-12T19:01:50+02:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-04-12T19:01:50+02:00 [ERROR] crates/extension/src/extension_store.rs:1106: failed to load wasm extension gleam
Caused by:
0: failed to instantiate wasm extension
1: import `zed:extension/github` has the wrong type
2: instance export `latest-github-release` has the wrong type
3: expected func found nothing
Hmm, in https://github.com/zed-industries/zed/pull/10052 we made it so installing an extension will install the latest compatible version.
But perhaps that isn't working as intended?
Hmm, interesting. Are you perhaps able to replicate the scenario above with the Gleam extension?
I can confirm this happened to me with the Gleam extension, and I also just confirmed it again with TOML. I am using Zed Zed 0.130.6 636e084d1d5940eaf8b8d2c46a1d18e178622cec Here’s what I did:
- Ensure TOML extension is not installed
- Search for
tomlin the extensions, and the install button is grayed out. When clicking the little dots and then "Install another version", it shows that the latest version is incompatible, see screenshot below. - Open a
.tomlfile and click "install" when Zed suggests to install the extension - Go back to the installed extensions, search for toml, and notice there is no upgrade button next to the uninstall button. This button is there (but disabled) if I manually install the compatible version (0.0.2 in this case), which (as far as I can tell) means the latest version is installed.
It would be cool if it explicitly showed the version that is installed, and not the latest version in the extensions list.
@cmuhire There was a problem where the Zed extension API wasn't respecting the constraints being passed up from Zed when installing an extension.
I just deployed a fix, and installing the Gleam extension from the suggestion toast in Zed v0.130.6 correctly installs v0.0.2 of the Gleam extension instead of v0.1.0.
Could you confirm this is working for you?
@maxdeviant I can confirm that it now installs the correct version, thanks for the fix! 🙌
a minor UI improvement that can be made later is to additonally indicate which version is currently installed as every extension currently shows the latest version number but no indication of currently installed version number (without manually checking extension source) :)