ca1989
How do you manage multiple versions of elixir-ls?
Hi all,
how do you manage multiple versions of elixir-ls?
Is there a tool similar to asdf to do that?
First Post!
arcanemachine
I haven’t dealt with the issue but if I had to, I would keep different versions of the program somewhere in directories with names based on the plugin version, e.g. ~/.local/share/elixir-ls/0.15.1.
I would have a symlink called ~/.local/bin/elixir-ls (or somewhere sensible that is in your $PATH) which points to the elixir-ls version in use at any given time, and reference that in the elixir.pathToElixirLS setting in my coc-settings.json file (I use NeoVim, so your config file would be different for e.g. VSCode).
Then I would make a script called elixir-ls-switch-version that looks something like this:
#!/usr/bin/env sh
if [ "$1" = "" ]; then
echo "You must pass the name of the elixir-ls version you want to use as the first positional parameter."
exit 2
elif [ "$1" = "ls" ]; then
echo "Here is a list of installed elixir-ls versions:"
ls ~/.local/share/elixir-ls
exit
fi
# make a new symlink containing the desired version of elixir-ls
path_to_new_symlink="~/.local/bin/elixir-ls"
echo "Making a new symlink..."
ln -sf "~/.local/share/elixir-ls/$1/language_server.sh $path_to_new_symlink"
I would place this script in my $PATH (probably in ~/.local/bin/elixir-ls-switch-version) and keep a backup in my handy-dandy scripts git repo.
Then, I would run elixir-ls-switch-version 0.15.1 (or run elixir-ls-switch-version ls if I want to see a list of installed versions).
Then, in NeoVim, I would run :CocRestart (or whatever the equivalent is for your editor of choice) and hope for the best!
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








