coc-elixir icon indicating copy to clipboard operation
coc-elixir copied to clipboard

it may fail when using asdf and other versioning tools

Open jalberto opened this issue 4 years ago • 2 comments

I work in different elixir projects that use different erlang and elixir versions, to manage this I use asdf so each project has a local file to define the correct versions and the system versions also come into play.

Is there a way to make elixir-lsp aware of this? so it rebuilds a new version when necessary with the correct combination.

jalberto avatar Feb 02 '21 09:02 jalberto

I use asdf as well...

I think the way to manage this is using "workspace" configuration: https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file#configuration-file-resolve

What I'm gleaning is that you want to specify a different coc-settings.json depending on project

According to the README, you can specify where the pre-compiled language server binary is:

{
  "elixir.pathToElixirLS": "~/.elixir-ls/release/language_server.sh"
}

I'd consider just just dumping it in my home directory under: ~/.elixir-ls/release/<version number>/language_server.sh

Instructions on how to build a language server for each version of Elixir that you're on can be found in the LS repo's README: https://github.com/elixir-lsp/elixir-ls

wulymammoth avatar Feb 03 '21 21:02 wulymammoth

So what fixed it for me was i already had set up this for a previous version of elixir https://github.com/elixir-lsp/coc-elixir#troubleshooting

I had to make sure the global version of elixir and erlang matched the version in the project, delete ~/.elixir-ls then run the commands in the readme link above to recompile the project

dylan-chong avatar Jul 23 '21 00:07 dylan-chong