This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the Visual Studio Code extension for ElixirLS (Elixir Language Server). It consists of two main parts:
- VS Code Extension (TypeScript/Node.js) - manages VS Code integration and spawns ElixirLS processes
- ElixirLS (Elixir) - implements Language Server Protocol (LSP) and Debug Adapter Protocol (DAP)
# Install VS Code extension dependencies
npm install
# Compile TypeScript
npm run compile
# Build ElixirLS
cd elixir-ls
mix deps.get
MIX_ENV=prod mix compile
# Full build for release
npm run vscode:prepublish# VS Code extension tests
npm test
# ElixirLS tests
cd elixir-ls
mix test
# Run specific test file
mix test test/diagnostics_test.exs
# Run specific test line
mix test test/diagnostics_test.exs:42
# Test specific app
cd apps/language_server && mix test# TypeScript linting/formatting (uses Biome)
npm run lint
npm run fix-formatting
# Elixir formatting
cd elixir-ls
mix format
mix format --check # Check without changing
# Type checking
mix dialyzer# Launch extension development host (press F5 in VS Code)
# Or manually:
code --extensionDevelopmentPath=.
# Watch TypeScript changes
npm run watch/src/- VS Code extension TypeScript source/elixir-ls/- Git submodule containing ElixirLS/apps/language_server/- Language server implementation/apps/debug_adapter/- Debug adapter implementation/apps/elixir_ls_utils/- Shared utilities
/syntaxes/- TextMate grammars for syntax highlighting
- VS Code extension spawns ElixirLS processes via launch scripts
- Communication happens over stdio using JSON-RPC
- Language server handles LSP requests (completion, diagnostics, etc.)
- Debug adapter handles DAP requests (breakpoints, stepping, etc.)
src/extension.ts- Extension entry pointsrc/vscode-elixir-ls-client.ts- Language client implementationsrc/commands.ts- VS Code command implementationssrc/task-provider.ts- Mix task integrationsrc/test-controller.ts- Test Explorer integration
apps/language_server/lib/language_server.ex- LSP server entryapps/language_server/lib/language_server/server.ex- Request handlingapps/language_server/lib/language_server/providers/- Feature providersapps/debug_adapter/lib/debug_adapter.ex- DAP server entry
- ElixirLS is a git submodule - remember to initialize/update it
- Tests on Linux require xvfb:
xvfb-run -a npm test - The extension spawns Erlang/Elixir processes - ensure proper cleanup
- Launch scripts in
elixir-ls/scripts/handle environment setup - Both LSP and DAP use stdio for communication, not TCP/IP