Adding elixir_sense to mix.exs seems to break autocomplete

Hi folks, I setup a new Ash project tonight, following the documentation for AshAuthentication. I added elixir_sense to mix.exs but this seems to be breaking autocomplete and other LSP functions. In case there is some difference between nvim and VS Code I tried both, but have the same issue. In the LSP logfile that nvim generates I see:
[WARN][2023-02-05 19:07:58] ...lsp/handlers.lua:487 "warning: undefined function add_first_alias_positions/3 (expected ElixirSense.Core.MetadataBuilder to define such a function or for it to be imported, but none are available)\n lib/elixir_sense/core/metadata_builder.ex:739\n"
[WARN][2023-02-05 19:07:58] ...lsp/handlers.lua:487 'could not compile dependency :elixir_sense, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile elixir_sense", update it with "mix deps.update elixir_sense" or clean it with "mix deps.clean elixir_sense"'
[WARN][2023-02-05 19:07:58] ...lsp/handlers.lua:487 "warning: undefined function add_first_alias_positions/3 (expected ElixirSense.Core.MetadataBuilder to define such a function or for it to be imported, but none are available)\n lib/elixir_sense/core/metadata_builder.ex:739\n"
[WARN][2023-02-05 19:07:58] ...lsp/handlers.lua:487 'could not compile dependency :elixir_sense, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile elixir_sense", update it with "mix deps.update elixir_sense" or clean it with "mix deps.clean elixir_sense"'
Ideas on how to overcome this? Or should I open an issue over in the Github Elixir Sense repo?
4 Replies
ZachDaniel
ZachDaniel3y ago
So the issue isn't really with elixir_sense its actually a version compatibility issue most likely The problem is that the older version of elixir-ls doesn't work with our elixir_sense plugin, and they still haven't released a new version of the VSCode package For now, I'm just going to remove the mentions of installing your own elixir_sense because that breaks too often (i.e if an update happens in elixir_sense that the old version of elixir-ls is incompatible with) And when they do a release of the new vscode package that will fix it If you are using nvim you may not have this problem? so you might just be able to remove elixir_sense entirely?
cro
croOP3y ago
That works, thanks!! I’ll watch for a new ElixirLS release & then try adding it back.
ZachDaniel
ZachDaniel3y ago
Have you checked to see if our custom resource autocomplete works for you?
cro
croOP3y ago
I don’t think it does, I’ll try again when I’m back at the keyboard.

Did you find this page helpful?