Interactive setup for Elixir LSP development environment
Sets up Elixir LSP with ElixirLS and Credo for code intelligence. Use this when starting Elixir development or when your editor's LSP integration isn't working.
/plugin marketplace add zircote/elixir-lsp/plugin install elixir-lsp@zircote-lspThis command will configure your Elixir development environment with ElixirLS and essential tools.
First, verify Elixir is installed:
elixir --version
mix --version
Download from GitHub releases: https://github.com/elixir-lsp/elixir-ls/releases
Or build from source:
git clone https://github.com/elixir-lsp/elixir-ls.git
cd elixir-ls
mix deps.get && mix compile
mix elixir_ls.release -o release
# Update hex and rebar
mix local.hex --force
mix local.rebar --force
# Install Credo for linting
mix archive.install hex credo --force
export ENABLE_LSP_TOOL=1
Test the integration:
# Create a test file
cat > test_lsp.ex << 'EOF'
defmodule Greeter do
def greet(name), do: "Hello, #{name}!"
end
EOF
# Format
mix format test_lsp.ex
# Clean up
rm test_lsp.ex