{"record":{"id":"993a5add9352723f","repo":"zed-industries/zed","slug":"unknown-settings-category","errorCode":null,"errorMessage":"Unknown settings category: {}","messagePattern":"Unknown settings category: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs","lineNumber":476,"sourceCode":"                    \"language\" => {\n                        let key = key.map(|k| LanguageName::new(&k));\n                        let settings = AllLanguageSettings::get(location, cx).language(\n                            location,\n                            key.as_ref(),\n                            cx,\n                        );\n                        Ok(serde_json::to_string(&settings::LanguageSettings {\n                            tab_size: settings.tab_size,\n                        })?)\n                    }\n                    \"lsp\" => {\n                        let settings = key\n                            .and_then(|key| {\n                                ProjectSettings::get(location, cx)\n                                    .lsp\n                                    .get(&::lsp::LanguageServerName(key.into()))\n                            })\n                            .cloned()\n                            .unwrap_or_default();\n                        Ok(serde_json::to_string(&settings::LspSettings {\n                            binary: settings.binary.map(|binary| settings::BinarySettings {\n                                path: binary.path,\n                                arguments: binary.arguments,\n                            }),\n                            settings: settings.settings,\n                            initialization_options: settings.initialization_options,\n                        })?)\n                    }\n                    _ => {\n                        bail!(\"Unknown settings category: {}\", category);\n                    }\n                })\n            }\n            .boxed_local()\n        })\n        .await","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs#L458-L494","documentation":"Thrown by the v0.1.0 settings host binding when an extension calls get_settings with a category string that is not \"language\" or \"lsp\". The v0.1.0 WIT surface only exposes those two categories; every other string falls into the wildcard match arm and bails. The host bindings are selected by the extension_api_version declared in extension.toml, so a newer-category call on an old-declared extension lands here.","triggerScenarios":"get_settings(location, category, key) with category not equal to \"language\" or \"lsp\" — e.g. \"context_servers\", \"project\", \"theme\", or a typo like \"languages\".","commonSituations":"Extension code copy-pasted from a newer extension that queries context-server settings, a typo in the category literal, or an extension that bumped its Rust zed_extension_api crate without bumping extension_api_version in extension.toml.","solutions":["Use only \"language\" or \"lsp\" as the category on the v0.1.0 API","If you need \"context_servers\", bump extension_api_version in extension.toml to a version whose host bindings support it","Check for typos/case: the match is exact and case-sensitive"],"exampleFix":"// before\nlet s = get_settings(None, \"context_servers\".into(), Some(key))?; // Unknown settings category\n\n// after\nlet s = get_settings(None, \"lsp\".into(), Some(\"rust-analyzer\".into()))?;\n// or bump `extension_api_version` in extension.toml to unlock \"context_servers\"","handlingStrategy":"validation","validationCode":"// before calling get_settings on the v0.1.0 API\nconst SUPPORTED_CATEGORIES: &[&str] = &[\"language\", \"lsp\"];\nif !SUPPORTED_CATEGORIES.contains(&category.as_str()) {\n    return Err(format!(\"category '{category}' not available on extension API v0.1.0\"));\n}","typeGuard":"fn is_supported_category_v0_1_0(category: &str) -> bool {\n    matches!(category, \"language\" | \"lsp\")\n}","tryCatchPattern":"match get_settings(None, category, key) {\n    Ok(json) => { /* deserialize */ }\n    Err(e) if e.starts_with(\"Unknown settings category\") => { /* degrade with defaults */ }\n    Err(e) => return Err(e),\n}","preventionTips":["Centralize category strings in constants instead of inline literals","Keep extension_api_version in extension.toml in sync with the zed_extension_api crate you compile against"],"tags":["settings","wasm","extension","zed","invalid-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}