LSPs
Crush can use LSPs (Language Server Protocol implementations) for additional context to help inform its decisions, just like you would.
Configuration
LSPs can be added manually in your crush.json:
json
{
"$schema": "https://charm.land/crush.json",
"lsp": {
"go": {
"command": "gopls",
"env": {
"GOTOOLCHAIN": "go1.24.5"
}
},
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"]
},
"nix": {
"command": "nil"
}
}
}Each entry is keyed by a language identifier. The available fields are:
| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | The executable to run |
args | string[] | No | Arguments passed to the command |
env | object | No | Environment variables for the server |
Auto-Discovery
Crush attempts to auto-discover LSPs for common languages. If an LSP binary is found on your PATH, Crush will start it automatically when working with files of that language.
Debugging LSP Connections
If an LSP isn't working as expected, enable debug logging:
json
{
"$schema": "https://charm.land/crush.json",
"options": {
"debug_lsp": true
}
}Then check the logs with crush logs --follow.
