Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting to stop constant upgrade message #1198

Open
jonahbeckford opened this issue Aug 9, 2023 · 5 comments
Open

Setting to stop constant upgrade message #1198

jonahbeckford opened this issue Aug 9, 2023 · 5 comments
Assignees
Labels

Comments

@jonahbeckford
Copy link
Contributor

With the DkML distribution (ie. the Windows one) the premise is to have a set of well-tested packages available to an end-user. "Well-tested" means a couple hundred of the most important OCaml packages are pinned to what is known to work on Windows. In fact, there is an offline version of the DkML installer that takes this idea further.

But having a stable set of versions, or an offline installation, is not supported:

There is a newer version of ocaml-lsp-server available. Consider upgrading from 1.15.1-4.14 to 1.16.2. Hint: $ opam install ocaml-lsp-server=1.16.2 and restart the lsp server

Every time VS Code launches that message is shown.

Can that message be shown once? Or have a "Stop this from being shown" action? Or have some hook (environment variable?) to stop the messages entirely?

Thanks.

@mnxn
Copy link
Collaborator

mnxn commented Aug 29, 2023

I've noticed this annoyance too.

However, while it would be possible to suppress this warning, my concern is what happens when extension depends on newer features in ocamllsp. This could lead to a confusing situation in which an extension feature is not working and a user has already suppressed the warning that explains the version incompatibility.

As far as I know, most other VS Code language extensions depend on the newest version of their respective language servers.

Have you considered bundling older .vsix extension packages from the releases in your offline installer? That way, you can "pin" the extension version in a similar way to the opam packages.

It is also possible to install older versions of the extension directly in VS Code:
image

After that, VS Code should ignore updates to the newer incompatible versions of the extension by default:
image

@jonahbeckford
Copy link
Contributor Author

Okay, if incompatibility is the problem that is being solved, that is useful to know.

Several issues with constant upgrade messages as the solution though:

  1. I haven't seen other plugins have unavoidable, repetitive upgrade messages. Actually, from my own experience I can't find a single one (and I'm a heavy vscode user ... TypeScript, C/C++, Java, OCaml, Python).
  2. This affects a growing percentage of the user base. Asking them to do a custom install is a bad user experience (and makes it seems like the users are second-class).
  3. This custom install would be a fork, no? And that fork would still presumably have to disable the offending UX message? So, the code would still need to be updated, but now that change would be in a fork (with forever maintenance costs).
  4. Most important: The constant upgrade message does not stop the incompatibility problem. And the upgrade message doesn't even tell the user the consequences. And the appearance of the upgrade message is not correlated to the appearance of the incompatibility problem: when and if OCaml breaks, the user won't know why it was broken.

By contrast, other vscode plugins may do a warning but provide you a config option to disable/fix the warning in the message itself. Examples:

Or they add a problem in the "Problems" pane, or auto-open the "Output" pane with a "This needs {tool} {version} or higher" message ... but only when the incompatibility is detected.

Or the more advanced ones provide their own compatible binary during the extension activation. (If you need a GitHub/GitLab CI job that always builds the latest ocamllsp.exe on Windows, that could be embedded / auto-downloaded ... that could be provided). That assumes that the latest ocamllsp.exe is 100% backwards compatible with old versions of Dune (is it?).

@ulugbekna ulugbekna self-assigned this Sep 15, 2023
@mnxn
Copy link
Collaborator

mnxn commented Sep 19, 2023

Sorry for the late response.
You make some good points and I agree that something needs to change.

First, to address a few specific things:

  • This custom install would be a fork, no? And that fork would still presumably have to disable the offending UX message?

    No, a fork wouldn't be neccessary. The most up-to-date version is statically embedded in the extension. That means installing version 1.12.1 of the extension (either through the marketplace or .vsix file) will not raise warnings when used with the now out-of-date version 1.15.0 of the language server. If an older version of the language server has to be used, an older version of the extension will be less likely to have incompatibilities.

  • the more advanced ones provide their own compatible binary during the extension activation.

    This would be the ideal solution, but would require many different binaries for the combinations of user systems and OCaml versions. At one point the extension had support for automatically building and installing tools into a hidden switch, but work stalled after UX issues if I remember correctly.

Now, here is my proposed solution to this issue:

  • Add a Don't show again button to the upgrade message that sets the value of a new extension setting.
  • Edit the wording of the upgrade message to mention the possible incompatibility from using an older version.
  • Change the color/icon of the status bar item when the language server is out of date. The status bar item is currently only used for changing sandboxes, but it could be extended with more extension information. This is less intrusive than an upgrade notification without completely hiding the information. I believe there are some language extensions that do this already.

@jonahbeckford
Copy link
Contributor Author

Your proposed solution sounds really good.

@rgrinberg
Copy link
Contributor

Yeah, that sounds reasonable to me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants