Build and Update Elixir-LS
Build and Update Elixir-LS
ElixirLS provides a language server that gives editors information about Elixir Mix projects.
I use nvim-lspconfig to integrate language servers with Neovim's built-in language server client. It makes it easier to launch and initialize language servers.
Keeping ElixirLS Up to Date
I forked and cloned the ElixirLS repo in ~/lsp/elixir-ls
.
To keep the fork up to date:
cd ~/lsp/elixir-ls
git switch master
git fetch upstream
git merge upstream/master --ff
Build ElixirLS
To build a new version of the LSP after fetching updates:
cd ~/lsp/elixir-ls
rm -rf /rel
mix deps.get
mix compile
mix elixir_ls.release -o rel
The command mix elixir_ls.release -o <release_dir>
comes from the docs. I named my release directory rel
. This is the configuration expected in my init.vim
setup for nvim-lspconfig. The required language server file will be built at ~/lsp/elixir-ls/rel/language_server.sh
.
Automate the Updating and Building
Here is a bash script to automate the process:
#!/usr/bin/env bash
# Update Elixir-LS
cd ~/lsp/elixir-ls
git switch master
git fetch upstream
git merge upstream/master --ff
# Build updated Elixir-LS
rm -rf /rel
mix deps.get
mix compile
mix elixir_ls.release -o rel