{"record":{"id":"30424ae412dad049","repo":"zed-industries/zed","slug":"could-not-read-semantic-token-rules-from","errorCode":null,"errorMessage":"Could not read semantic token rules from {}","messagePattern":"Could not read semantic token rules from (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/settings_content/src/project.rs","lineNumber":285,"sourceCode":"    /// Set to 0 to disable auto-dismiss.\n    ///\n    /// Default: 5000\n    pub dismiss_timeout_ms: Option<u64>,\n}\n\n/// Custom rules for rendering LSP semantic tokens.\n#[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    }","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/settings_content/src/project.rs#L267-L303","documentation":"IO context in SemanticTokenRules::load(): std::fs::read of semantic_token_rules.json failed (missing file, permissions, or other IO error). The path is embedded so the user knows which file could not be read.","triggerScenarios":"Thrown at crates/settings_content/src/project.rs:285 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure semantic_token_rules.json exists and is readable","Fix the file path configured for custom semantic token rules"],"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"}