zed-industries/zed · error · anyhow::Error

Unknown settings category: {}

Error message

Unknown settings category: {}

What it means

The v0.8.0 get_settings host binding recognizes exactly three category strings — "language", "lsp", and "context_servers" — and bails on anything else via the wildcard arm. The category match is exact and case-sensitive; an unrecognized string is rejected before any settings lookup happens.

Source

Thrown at crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs:1034

                            });

                        match settings {
                            project::project_settings::ContextServerSettings::Stdio {
                                enabled: _,
                                command,
                                ..
                            } => Ok(serde_json::to_string(&settings::ContextServerSettings {
                                command: Some(settings::CommandSettings {
                                    path: command.path.to_str().map(|path| path.to_string()),
                                    arguments: Some(command.args),
                                    env: command.env.map(|env| env.into_iter().collect()),
                                }),
                                settings: None,
                            })?),
                            project::project_settings::ContextServerSettings::Extension {
                                enabled: _,
                                settings,
                                ..
                            } => Ok(serde_json::to_string(&settings::ContextServerSettings {
                                command: None,
                                settings: Some(settings),
                            })?),
                            project::project_settings::ContextServerSettings::Http { .. } => {
                                bail!("remote context server settings not supported in 0.6.0")
                            }
                        }
                    }
                    _ => {
                        bail!("Unknown settings category: {}", category);
                    }
                })
            }
            .boxed_local()
        })
        .await
        .to_wasmtime_result()

View on GitHub (pinned to 5a9b9558db)

Solutions

  1. Use one of "language", "lsp", "context_servers" exactly as spelled
  2. Check for leading/trailing whitespace and case in the category literal
  3. If a genuinely new category is needed, bump extension_api_version to bindings that expose it

Example fix

// before
let s = get_settings(None, "project".into(), None)?; // Unknown settings category: project

// after
let s = get_settings(None, "lsp".into(), Some("rust-analyzer".into()))?;
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_CATEGORIES: &[&str] = &["language", "lsp", "context_servers"];
if !SUPPORTED_CATEGORIES.contains(&category.as_str()) {
    return Err(format!("unsupported settings category '{category}'"));
}

Type guard

fn is_supported_category_v0_8_0(category: &str) -> bool {
    matches!(category, "language" | "lsp" | "context_servers")
}

Try / catch

match get_settings(location, category, key) {
    Ok(json) => { /* ... */ }
    Err(e) if e.starts_with("Unknown settings category") => { /* use defaults */ }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: get_settings(location, category, key) with a category other than "language", "lsp", or "context_servers" — e.g. "project", "theme", "buffer", or a typo like "Language".

Common situations: Extension authors guessing at a settings namespace that the WIT surface never exposed, case mismatches, or code written for a future/newer API version run against these bindings.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of zed-industries/zed@5a9b9558db (2026-08-20). Data as JSON: /api/errors/9f32cac95b9203f2. Report an issue: GitHub.