charmbracelet/crush · error
no LSP client handles any file matching
Error message
no LSP client handles any file matching '%s'
What it means
Even when grep finds textual matches, resolveSymbolResults must map each match to an LSP client whose language handlers cover the matched file. If findLSPClient returns nil for every matched file, results is empty and this error is thrown: no configured LSP server handles the file type.
Solutions
- Add an lsp block for the language to crushrc (e.g. lsp gopls for Go).
- Verify the LSP server binary is installed and starts (check logs).
- Search in files of a handled type, or navigate to the definition file directly and operate there.
- Confirm LSP auto-discovery found the server for the project.
Example fix
// before
# crushrc: no lsp configured
# after
lsp gopls {
command gopls
} Defensive patterns
Strategy: fallback
Validate before calling
if findLSPClient(lspManager, filePath) == nil {
return errors.New("no LSP client for " + filepath.Ext(filePath))
} Type guard
null
Try / catch
if err != nil {
if strings.Contains(err.Error(), "no LSP client handles") { /* configure LSP for that language */ }
} Prevention
- Configure lsp blocks in crushrc for every language in the project
- Verify LSP server binaries are installed and discoverable
- Keep symbol operations within file types covered by configured LSPs
When it happens
Trigger: Resolving a symbol whose occurrences are all in file types with no LSP configured (e.g. a .md or .txt file when only a Go LSP is registered), or when no LSP servers are configured at all.
Common situations: Missing lsp configuration in crushrc for the relevant language; symbol appears only in docs/comments of unhandled file types; LSP for the language failed to start so no client is registered.
Related errors
- failed to initialize the lsp client
- cannot notify change for unopened file
- cannot reload: working directory not set
- could not build runner for
- could not create request
AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29).
Data as JSON: /api/errors/d66f326464420dfe.
Report an issue: GitHub.
Appendix: source
Thrown at internal/agent/tools/lsp_helpers.go:88
if err != nil {
continue
}
client := findLSPClient(lspManager, absPath)
if client == nil {
continue
}
results = append(results, &resolvedSymbol{
client: client,
path: absPath,
line: match.lineNum,
char: match.charNum + getSymbolOffset(symbol),
})
}
if len(results) == 0 {
return nil, fmt.Errorf("no LSP client handles any file matching '%s'", symbol)
}
return results, nil
}
// findLSPClient returns the first LSP client that handles the given file path.
func findLSPClient(lspManager *lsp.Manager, filePath string) *lsp.Client {
if abs, err := filepath.Abs(filePath); err == nil {
filePath = abs
}
for c := range lspManager.Clients().Seq() {
if c.HandlesFile(filePath) {
return c
}
}
return nil
}
// collectAffectedFiles extracts all unique file paths from a WorkspaceEdit.View on GitHub (pinned to 7944b8e522)