zed-industries/zed · error

language server {server_id} not found

Error message

language server {server_id} not found

What it means

Sentinel guard in execute_command (lsp_store): the local mode branch looked up the language server via language_server_for_id(server_id) and got None, meaning the requested server id is not registered in this project — it was removed, never started, or the id belongs to a remote/other project session.

Source

Thrown at crates/project/src/lsp_store.rs:6654

                project_id,
                language_server_id: server_id.to_proto(),
                command,
                arguments: arguments
                    .iter()
                    .map(|argument| argument.to_string())
                    .collect(),
            });
            cx.background_spawn(async move {
                let response = request.await?;
                response
                    .result
                    .map(|result| serde_json::from_str(&result))
                    .transpose()
                    .context("deserializing executeCommand result")
            })
        } else if self.mode.is_local() {
            let Some(server) = self.language_server_for_id(server_id) else {
                return Task::ready(Err(anyhow!("language server {server_id} not found")));
            };
            let available_commands = server
                .capabilities()
                .execute_command_provider
                .as_ref()
                .map(|options| options.commands.clone())
                .unwrap_or_default();
            if !available_commands.contains(&command) {
                return Task::ready(Err(anyhow!(
                    "command {command} is not advertised by the language server"
                )));
            }
            let request_timeout = ProjectSettings::get_global(cx)
                .global_lsp_settings
                .get_request_timeout();
            cx.background_spawn(async move {
                server
                    .request::<lsp::request::ExecuteCommand>(

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Refresh the language server list before retrying; the server may have been restarted under a new id
  2. Check that the caller obtained server_id from this project (e.g. via language_server_for_buffer) rather than a stale cached id
  3. Return a user-facing error explaining the language server is no longer available for this project
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/project/src/lsp_store.rs:6654 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-09-12). Data as JSON: /api/errors/ca8a9944f10877cd. Report an issue: GitHub.