elixir_sense icon indicating copy to clipboard operation
elixir_sense copied to clipboard

What does providers being deprecated mean for plugins?

Open zachdaniel opened this issue 1 year ago • 2 comments

Just saw this warning: ElixirSense.suggestions/3 is deprecated. providers will be dropped in the future.

What does this mean for ElixirSense's plugin setup? We utilize this heavily for Ash Framework.

zachdaniel avatar Mar 16 '24 18:03 zachdaniel

@zachdaniel Provider code has been moved to ElixirLS in almost not changed form. I don't currently plan to break compatibility with the plugins but I'm unhappy with some aspects

  1. The current approach scans all modules for plugins on each complete request. This introduces noticeable delay as it reaches over the code server. We need a better plugin registration mechanism.
  2. Plugins are currently the most common crash reason. When a plugin loads it unloads elixir_sense modules from the ElixirLS release. It loads it's own older version of those modules and since then ElixirLS breaks in weirdest places with UndefinedFunctionError, MatchError. Loading a plugin must not unload/overwrite ElixirLS internal modules. ElixirSense.Plugin behaviour will either need to be extracted to a separate library (and renamed to ElixirLS.Plugin) or the plugins should not implement it explicitly.
  3. So far the plugin architecture only supports completions but we already have a need for definitions plugin.

lukaszsamson avatar Mar 17 '24 08:03 lukaszsamson

This all sounds great to me 👍. I’ve got no issue reworking our plugin to meet a new api, and I’ve also got no problem if there is like an “install” step that users have to do, like putting something in their config. Let me know how I can help on this front :)

zachdaniel avatar Mar 17 '24 13:03 zachdaniel

Since Lexical relies on elixir_sense plugins a had to revert most of the changes. At least for now the providers are here to stay

lukaszsamson avatar Dec 10 '24 22:12 lukaszsamson