{"record":{"id":"f5e23d9bb423d760","repo":"zed-industries/zed","slug":"command-command-is-not-advertised-by-the-language-server","errorCode":null,"errorMessage":"command {command} is not advertised by the language server","messagePattern":"command (.+?) is not advertised by the language server","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/lsp_store.rs","lineNumber":6663,"sourceCode":"                let response = request.await?;\n                response\n                    .result\n                    .map(|result| serde_json::from_str(&result))\n                    .transpose()\n                    .context(\"deserializing executeCommand result\")\n            })\n        } else if self.mode.is_local() {\n            let Some(server) = self.language_server_for_id(server_id) else {\n                return Task::ready(Err(anyhow!(\"language server {server_id} not found\")));\n            };\n            let available_commands = server\n                .capabilities()\n                .execute_command_provider\n                .as_ref()\n                .map(|options| options.commands.clone())\n                .unwrap_or_default();\n            if !available_commands.contains(&command) {\n                return Task::ready(Err(anyhow!(\n                    \"command {command} is not advertised by the language server\"\n                )));\n            }\n            let request_timeout = ProjectSettings::get_global(cx)\n                .global_lsp_settings\n                .get_request_timeout();\n            cx.background_spawn(async move {\n                server\n                    .request::<lsp::request::ExecuteCommand>(\n                        lsp::ExecuteCommandParams {\n                            command,\n                            arguments,\n                            ..lsp::ExecuteCommandParams::default()\n                        },\n                        request_timeout,\n                    )\n                    .await\n                    .into_response()","sourceCodeStart":6645,"sourceCodeEnd":6681,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/project/src/lsp_store.rs#L6645-L6681","documentation":"Validation guard in execute_command: the server was found, but its executeCommandProvider capability does not list the requested command. The server itself declares which commands it supports; sending an unadvertised command would be rejected server-side, so it is refused locally before any request.","triggerScenarios":"Thrown at crates/project/src/lsp_store.rs:6663 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the command name for typos or version differences; the server's advertised commands may have changed between versions","Query server.capabilities().execute_command_provider to enumerate valid commands before invoking","If the server genuinely supports it but omits it from capabilities, allow-list the command as a workaround"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-09-12T19:35:53.743Z","contentChangedAt":"2026-09-12T19:35:53.743Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}