{"record":{"id":"873cc0be895259b4","repo":"zed-industries/zed","slug":"failed-to-parse-semantic-token-rules-from","errorCode":null,"errorMessage":"Failed to parse semantic token rules from {}","messagePattern":"Failed to parse semantic token rules from (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/settings_content/src/project.rs","lineNumber":292,"sourceCode":"#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, JsonSchema)]\n#[serde(transparent)]\npub struct SemanticTokenRules {\n    pub rules: Vec<SemanticTokenRule>,\n}\n\nimpl SemanticTokenRules {\n    pub const FILE_NAME: &'static str = \"semantic_token_rules.json\";\n\n    pub fn load(file_path: &Path) -> anyhow::Result<Self> {\n        let rules_content = std::fs::read(file_path).with_context(|| {\n            anyhow::anyhow!(\n                \"Could not read semantic token rules from {}\",\n                file_path.display()\n            )\n        })?;\n\n        serde_json_lenient::from_slice::<SemanticTokenRules>(&rules_content).with_context(|| {\n            anyhow::anyhow!(\n                \"Failed to parse semantic token rules from {}\",\n                file_path.display()\n            )\n        })\n    }\n}\n\nimpl crate::merge_from::MergeFrom for SemanticTokenRules {\n    fn merge_from(&mut self, other: &Self) {\n        self.rules.splice(0..0, other.rules.iter().cloned());\n    }\n}\n\n#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, JsonSchema)]\n#[serde(rename_all = \"snake_case\")]\npub struct SemanticTokenRule {\n    pub token_type: Option<String>,\n    #[serde(default)]","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/settings_content/src/project.rs#L274-L310","documentation":"Parse context in SemanticTokenRules::load(): the file was read but serde_json_lenient could not parse its contents into SemanticTokenRule entries. The underlying syntax error is wrapped by this message naming the file.","triggerScenarios":"Thrown at crates/settings_content/src/project.rs:292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the JSON syntax and schema of semantic_token_rules.json","Validate the file against the SemanticTokenRules schema"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T05:17:10.506Z"}