{"record":{"id":"cc6a4237f19db0aa","repo":"zed-industries/zed","slug":"unexpected-json-code-block-tag-label","errorCode":null,"errorMessage":"Unexpected JSON code block tag: {label}","messagePattern":"Unexpected JSON code block tag: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/docs_preprocessor/src/main.rs","lineNumber":576,"sourceCode":"                    snippet_json_fixed.insert(0, '{');\n                    snippet_json_fixed.push_str(\"\\n}\");\n                }\n\n                settings::parse_json_with_comments::<theme::IconThemeFamilyContent>(\n                    &snippet_json_fixed,\n                )?;\n            }\n            \"semantic_token_rules\" => {\n                if !snippet_json_fixed.starts_with('[') || !snippet_json_fixed.ends_with(']') {\n                    snippet_json_fixed.insert(0, '[');\n                    snippet_json_fixed.push_str(\"\\n]\");\n                }\n\n                settings::parse_json_with_comments::<settings::SemanticTokenRules>(\n                    &snippet_json_fixed,\n                )?;\n            }\n            label => anyhow::bail!(\"Unexpected JSON code block tag: {label}\"),\n        };\n        Ok(())\n    });\n\n    Ok(())\n}\n\n/// Removes any configurable options from the stringified action if existing,\n/// ensuring that only the actual action name is returned. If the action consists\n/// only of a string and nothing else, the string is returned as-is.\n///\n/// Example:\n///\n/// This will return the action name unmodified.\n///\n/// ```\n/// let action_as_str = \"workspace::Save\";\n/// let action_name = name_for_action(action_as_str);","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/docs_preprocessor/src/main.rs#L558-L594","documentation":"Zed's docs preprocessor rewrites fenced JSON blocks in documentation by their tag label (`\"settings\"`, `\"semantic_token_rules\"`, …, then fixes them up and parses with `parse_json_with_comments`); any unrecognized label falls into the catch-all arm and aborts the whole docs build with `Unexpected JSON code block tag: {label}` (main.rs:576).","triggerScenarios":"A markdown file under the docs tree containing a fenced code block whose info string resolves to an unhandled label — a typo like `\"setting\"`, a renamed tag, or a genuinely new tag category added without a match arm.","commonSituations":"Contributing new docs sections with a new block kind; renaming an existing tag in markdown but not the preprocessor; CI docs generation failing right after a markdown edit.","solutions":["Fix the tag in the markdown to one of the handled labels (e.g. `settings`, `semantic_token_rules`).","If the tag is intentionally new, add a match arm for it in the preprocessor before the `label =>` catch-all.","Re-run the preprocessor to confirm the docs build passes."],"exampleFix":"```json setting     // before — typo, hits catch-all arm\n{ \"show_edit_predictions\": true }\n```\n\n```json settings    // after — handled label\n{ \"show_edit_predictions\": true }\n```","handlingStrategy":"validation","validationCode":"// lint docs markdown for unknown block tags before running the preprocessor\nconst KNOWN = new Set([\"settings\", \"semantic_token_rules\" /* , other handled labels */]);\nfor (const m of markdown.matchAll(/```json\\s+(\\w+)/g)) {\n  if (!KNOWN.has(m[1])) throw new Error(`Unexpected JSON code block tag: ${m[1]}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the handled-label set next to the docs style guide.","Add a CI lint that fails on unknown tags before the full preprocessor run.","When introducing a new tag, update the match arm and the lint in the same change."],"tags":["docs","markdown","build-tooling","zed"],"backgroundTag":"markdown-parsing-failed","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"}