Search code examples
visual-studio-coderust-analyzer

Why does the rust-analyzer VS Code extension insist on being out-of-date?


I can not get a version of the rust-analyzer extension more recent than ~7 months out of date. I see that the latest version is 0.3.2020 and yet when I install the extension and reload VS Code, it has installed 0.3.1730. The rust-analyzer changelog says this version was released 2023-11-13.

Pre install: rust-analyzer extension shows v0.3.2020 as latest version

Post install: rust-analyzer extension shows v0.3.1730 as installed version

Accessing the "Uninstall" dropdown and selecting "Install Another Version..." yields a list with seemingly all versions 0.3.1730 and prior. Trying to manually enter in "0.3.2020" results in an empty list and pressing Enter does nothing.

command palette shows versions 0.3.1730, 0.3.1722, 0.3.1713, and prior

There is a pre-release channel which should have 0.4.2023 as the latest version, but installing it gives me 0.4.1731. Trying to "Install Another Version..." there was similarly fruitless.

Trying to install a version downloaded directly from the marketplace just yields an error "One or more extensions are for Visual Studio Code. Try installing them in Visual Studio Code." Not helpful.

This is fairly important because rust-analyzer should be relatively in-sync with the Rust version you're using. With them out-of-sync, the user experience is pretty poor mostly due to errors with proc-macro evaluation. But obviously to make them in-sync requires downgrading my Rust version which I would like to avoid.

I have looked at rust-analyzer specific issues and have not noticed anyone else reporting these symptoms. So I feel it is likely an issue with my setup but I don't know how to debug the behavior.

I am on Windows 10. VS Code version 1.77.0. I don't seem to have an issue with other extensions.


Solution

  • Update VS Code.

    When finishing up the question above, I found that 1.77.0 is very out of date (March 2023 release was ~16 months ago). Updating to the latest 1.91.0 allowed the latest version of rust-analyzer to be installed.

    I had apparently disabled updates at some point and just never noticed over the past year. I would've liked some kind of "latest version could not be installed due to ..." warning, but I'm guessing this scenario is not common.