Crush can use Language Server Protocol (LSP) servers for additional context to help inform its decisions, just like your code editor does. LSPs provide Crush with:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/charmbracelet/crush/llms.txt
Use this file to discover all available pages before exploring further.
- Code intelligence - Type information, definitions, references
- Diagnostics - Errors, warnings, and code quality issues
- Navigation - Jump to definitions, find references
- Contextual understanding - Better comprehension of your codebase structure
How It Works
When working with code, Crush can query LSP servers to:- Get diagnostic information about files
- Find references to functions, types, and variables
- Navigate code structure and relationships
- Understand type information and signatures
Configuration
Configure LSP servers in yourcrush.json file:
Configuration Options
Each LSP server configuration supports these fields:command
Type:string
The executable command for the LSP server.
args
Type:string[]
Command-line arguments to pass to the LSP server.
env
Type:object
Environment variables to set for the LSP server process.
disabled
Type:booleanDefault:
false
Disable a specific LSP server without removing its configuration.
filetypes
Type:string[]
File extensions this LSP server handles.
root_markers
Type:string[]
Files or directories that indicate the project root.
options
Type:object
LSP server-specific settings passed during initialization.
init_options
Type:object
Initialization options passed during the LSP initialize request.
timeout
Type:integerDefault:
30
Timeout in seconds for LSP server initialization.
Example Configurations
Go (gopls)
Advanced configuration with gopls options:TypeScript
Nix
Rust
Python
Installing LSP Servers
Before configuring an LSP server, make sure it’s installed:Debugging LSP Issues
Enable LSP debug logging:./.crush/logs/crush.log in your project directory.
Auto LSP Discovery
Crush can automatically discover and configure LSP servers based on root markers in your project:Auto LSP discovery is enabled by default. Set to
false to disable.Next Steps
MCP Servers
Add Model Context Protocol servers
Tools
Learn about Crush’s built-in tools