elixir-ls
elixir-ls copied to clipboard
Feature: Prompt to update deps when change detected
I finally had to disable the "Fetch Deps" feature on ElixirLS because it was causing so many problems when switching between branches. There are times that I love the fact that it detects a change and updates, but if I do a bunch of changes on a feature branch, for instance removing a dependency, and merge the PR, then when I swap back to master, before I can pull the merged version, ElixirLS does an update and re-pulls the old deps that I got rid of. I end up having to delete build, deps, and elixirls build, then restart ElixirLS.
Right now the feature is either on or off. I would like the option to be prompted when deps changes are detected (the VS code popup in the bottom right) and then I can choose if I want to update deps or not.
I think this is a great idea and it happens infrequently enough that prompting should be fine.
Thinking more about the UX, I wonder if we kept the existing single "automatically fetch" option, and when it is unchecked, it alerts the user of pending changes, with buttons "Update", "Ignore", "Always Update" (the third one enables the auto setting in addition to running it immediately). When the auto setting is enabled, it notifies whenever it automatically updates, but has buttons "Ok", which dismisses the dialog, and "ask me first next time", which unchecks the setting.
I also just remembered that I had to specifically add code to Project Ironman to handle this, because I would save an updated mix.exs, then try to run mix deps.get, and it would regularly collide with the ElixirLS process doing the same thing and time out.
Hmmm, guess I forgot to consider the configuration option properly. I think that should be changed to be a string enum with values: ["automatically", "prompt", "never"] with a new default of "prompt". On the server we'd map true (the old default) to "prompt".
I'm not sure about having an "Always Update" setting right now because there isn't a way to persistently change that from the server.
When the auto setting is enabled, it notifies whenever it automatically updates, but has buttons "Ok", which dismisses the dialog, and "ask me first next time", which unchecks the setting.
I don't think this is possible via the LSP, either you have to prompt the user (which means waiting until they respond), or just a plain log without any associated actions.
On the server we'd map true (the old default) to "prompt".
If we mapped all legacy values to "prompt" then those of us who turned it off because it was problematic would be notified about the new options instead of it going unnoticed to anyone that doesn't read the release notes (which I am guessing most users). Those that really wanted it off completely would only have a single click to return to that behaviour.
I don't think this is possible via the LSP, either you have to prompt the user (which means waiting until they respond), or just a plain log without any associated actions.
Ahh, I am not familiar with how VSCode works. If you can't fire off the deps.get and then pop a prompt with buttons, then yeah you would have to just pop the current "we are updating your deps" text when auto is set.