{"record":{"id":"b709cd047a0f5d98","repo":"Hmbown/CodeWhale","slug":"lsp-request-not-supported-by-this-transport","errorCode":null,"errorMessage":"LSP request not supported by this transport","messagePattern":"LSP request not supported by this transport","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lsp/client.rs","lineNumber":109,"sourceCode":"pub trait LspTransport: Send + Sync {\n    /// Notify the server that a file was opened or its contents updated, then\n    /// wait up to `wait` for a `publishDiagnostics` notification for that\n    /// file. Returns the diagnostics list (possibly empty). Implementations\n    /// must NOT block past `wait`.\n    async fn diagnostics_for(\n        &self,\n        path: &Path,\n        text: &str,\n        wait: Duration,\n    ) -> Result<DiagnosticPublication>;\n\n    /// Send a JSON-RPC request and wait up to `wait` for the reply.\n    ///\n    /// Default returns \"unsupported\" so diagnostic-only fakes keep working.\n    /// Real transports implement this for go-to-definition, symbols, and\n    /// references without spawning a second server lifecycle.\n    async fn request(&self, _method: &str, _params: Value, _wait: Duration) -> Result<Value> {\n        Err(anyhow!(\"LSP request not supported by this transport\"))\n    }\n\n    /// Synchronize and query one document atomically when the transport can\n    /// prove that ordering. Diagnostic-only/legacy transports stay unverified.\n    async fn request_for_document(\n        &self,\n        path: &Path,\n        text: &str,\n        method: &str,\n        params: Value,\n        wait: Duration,\n    ) -> Result<SemanticReply> {\n        timeout(wait, async {\n            self.ensure_open(path, text).await?;\n            Ok(SemanticReply {\n                result: self.request(method, params, wait).await?,\n                document_version: None,\n            })","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lsp/client.rs#L91-L127","documentation":"The default `LspTransport::request` implementation returns this error for transports that only support diagnostics. Full JSON-RPC request/response (definition, symbols, references) is unsupported there, so any caller attempting a semantic request against such a transport fails immediately.","triggerScenarios":"Calling go-to-definition/document-symbols/references (or `request_for_document`) on a diagnostic-only or fake LSP transport that has not overridden `request`.","commonSituations":"Running with a minimal/diagnostic LSP integration; tests using fake transports; a server integration that never implemented the request path.","solutions":["Use a transport that implements `request` (e.g. StdioLspTransport)","Check the transport's capability before issuing semantic requests and degrade gracefully","Implement `request` for your custom transport"],"exampleFix":"// before\nlet reply = transport.request(\"textDocument/definition\", params, wait).await?;\n// after\nlet reply = match transport.request(\"textDocument/definition\", params, wait).await {\n    Ok(v) => v,\n    Err(e) if e.to_string().contains(\"not supported\") => return fallback_symbol_lookup(),\n    Err(e) => return Err(e),\n};","handlingStrategy":"fallback","validationCode":"const supportsRequests = typeof transport.request === 'function' && transport.implementsRequests === true;","typeGuard":"fn supports_semantic(t: &dyn LspTransport) -> bool { t.capabilities().semantic_requests }","tryCatchPattern":"match transport.request(method, params, wait).await {\n    Ok(v) => Ok(v),\n    Err(e) if e.to_string().contains(\"not supported\") => fallback_lookup(),\n    Err(e) => Err(e),\n}","preventionTips":["Advertise transport capabilities explicitly and check before semantic calls","Route semantic requests only to StdioLspTransport","Provide a non-LSP fallback for definition/symbol lookups"],"tags":["lsp","transport","unsupported"],"backgroundTag":"method-not-implemented","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}