sway icon indicating copy to clipboard operation
sway copied to clipboard

Warn users when their `forc` toolchain is out of date

Open sdankel opened this issue 2 years ago • 1 comments

forc should should notify users when their active toolchain is out of date. E.g. if they use forc commands on the beta-4 toolchain, but there are new patch releases available it could have some warning message that they are on an out of date version. Same for the LSP - perhaps we could propagate this message in the editor somehow.

A single console message would be good, similar to what the github cli does when you use it and there is a new update you havent applied yet:

A new release of gh is available: 2.32.1 → 2.38.0
To upgrade, run: brew upgrade gh
https://github.com/cli/cli/releases/tag/v2.38.0

sdankel avatar Nov 15 '23 18:11 sdankel

This would be nice, but it would also require us to download the metadata file from fuelup to check if there is a new release available every time a forc command is run. If we do that, we should make the code that does that in fuelup available as a library since both forc and forc-lsp will have to do that same check.

Specifically for LSP + VSCode, we could implement this without having to download the channel by having a "latest forc version" specified in the extension (perhaps in a custom key-value pair in package.json), that we update when making a release of the VSCode plugin. The VSCode plugin already checks the executable's version before starting the server, so at that point it could check against the latest version and pop up a warning if the executable version is older than what the VSCode plugin expects.

The downside to this approach is that we'd have to remember update this minimum forc version when doing a release of the plugin in order for the warning to be up to date.

sdankel avatar Jul 01 '24 20:07 sdankel