{"record":{"id":"d66f326464420dfe","repo":"charmbracelet/crush","slug":"no-lsp-client-handles-any-file-matching-s","errorCode":null,"errorMessage":"no LSP client handles any file matching '%s'","messagePattern":"no LSP client handles any file matching '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/tools/lsp_helpers.go","lineNumber":88,"sourceCode":"\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tclient := findLSPClient(lspManager, absPath)\n\t\tif client == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tresults = append(results, &resolvedSymbol{\n\t\t\tclient: client,\n\t\t\tpath:   absPath,\n\t\t\tline:   match.lineNum,\n\t\t\tchar:   match.charNum + getSymbolOffset(symbol),\n\t\t})\n\t}\n\n\tif len(results) == 0 {\n\t\treturn nil, fmt.Errorf(\"no LSP client handles any file matching '%s'\", symbol)\n\t}\n\treturn results, nil\n}\n\n// findLSPClient returns the first LSP client that handles the given file path.\nfunc findLSPClient(lspManager *lsp.Manager, filePath string) *lsp.Client {\n\tif abs, err := filepath.Abs(filePath); err == nil {\n\t\tfilePath = abs\n\t}\n\tfor c := range lspManager.Clients().Seq() {\n\t\tif c.HandlesFile(filePath) {\n\t\t\treturn c\n\t\t}\n\t}\n\treturn nil\n}\n\n// collectAffectedFiles extracts all unique file paths from a WorkspaceEdit.","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/agent/tools/lsp_helpers.go#L70-L106","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n# crushrc: no lsp configured\n# after\nlsp gopls {\n    command gopls\n}","handlingStrategy":"fallback","validationCode":"if findLSPClient(lspManager, filePath) == nil {\n    return errors.New(\"no LSP client for \" + filepath.Ext(filePath))\n}","typeGuard":"null","tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"no LSP client handles\") { /* configure LSP for that language */ }\n}","preventionTips":["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"],"tags":["lsp","configuration","language-server"],"backgroundTag":"no-lsp-client-for-filetype","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}