{"record":{"id":"82580ade11e46494","repo":"zed-industries/zed","slug":"keymap-schema-should-serialize","errorCode":null,"errorMessage":"Keymap schema should serialize","messagePattern":"Keymap schema should serialize","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/json_schema_store/src/json_schema_store.rs","lineNumber":42,"sourceCode":"\nstatic SNIPPETS_SCHEMA: LazyLock<String> = LazyLock::new(|| {\n    serde_json::to_string(&snippet_provider::format::VsSnippetsFile::generate_json_schema())\n        .expect(\"VsSnippetsFile schema should serialize\")\n});\n\nstatic JSONC_SCHEMA: LazyLock<String> = LazyLock::new(|| {\n    serde_json::to_string(&generate_jsonc_schema()).expect(\"JSONC schema should serialize\")\n});\n\n#[cfg(debug_assertions)]\nstatic INSPECTOR_STYLE_SCHEMA: LazyLock<String> = LazyLock::new(|| {\n    serde_json::to_string(&generate_inspector_style_schema())\n        .expect(\"Inspector style schema should serialize\")\n});\n\nstatic KEYMAP_SCHEMA: LazyLock<String> = LazyLock::new(|| {\n    serde_json::to_string(&settings::KeymapFile::generate_json_schema_from_inventory())\n        .expect(\"Keymap schema should serialize\")\n});\n\nstatic ACTION_SCHEMA_CACHE: LazyLock<RwLock<HashMap<String, String>>> =\n    LazyLock::new(|| RwLock::new(HashMap::default()));\n\n// Runtime cache for dynamic schemas that depend on runtime state:\n// - \"settings\": depends on installed fonts, themes, languages, LSP adapters (extensions can add these)\n// - \"settings/lsp/*\": depends on LSP adapter initialization options\n// - \"debug_tasks\": depends on DAP adapters (extensions can add these)\n// Cache is invalidated via notify_schema_changed() when extensions or DAP registry change.\nstatic DYNAMIC_SCHEMA_CACHE: LazyLock<RwLock<HashMap<String, String>>> =\n    LazyLock::new(|| RwLock::new(HashMap::default()));\n\npub fn init(cx: &mut App) {\n    cx.set_global(SchemaStore::default());\n    project::lsp_store::json_language_server_ext::register_schema_handler(\n        handle_schema_request,\n        cx,","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/json_schema_store/src/json_schema_store.rs#L24-L60","documentation":"LazyLock initializer panic: serde_json failed to serialize the generated JSON schema for the keymap settings file. Since the schema types use derive-based serialization, failure indicates the schemars-derived Serialize impl returned an error (or a non-string map key), which for these settings types is considered a programming error — the message asserts serialization is statically guaranteed to succeed.","triggerScenarios":"Thrown at crates/json_schema_store/src/json_schema_store.rs:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reproduce by calling serde_json::to_string on KeymapFile::generate_json_schema() in a test to surface the underlying serde error","Check any custom Serialize/JsonSchema impls on keymap settings types for fallible paths","Fix the type or serializer so serialization is infallible, preserving the invariant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}