{"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":373,"sourceCode":"    /// Timeout in milliseconds for automatically dismissing language server notifications.\n    /// 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_to_string(file_path).with_context(|| {\n            anyhow::anyhow!(\n                \"Could not read semantic token rules from {}\",\n                file_path.display()\n            )\n        })?;\n\n        Self::parse(&rules_content).with_context(|| {\n            anyhow::anyhow!(\n                \"Failed to parse semantic token rules from {}\",\n                file_path.display()\n            )\n        })\n    }\n\n    pub fn parse(file_content: &str) -> anyhow::Result<Self> {\n        serde_json_lenient::from_str::<SemanticTokenRules>(file_content)\n            .context(\"failed to parse semantic token rules\")\n    }","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/settings_content/src/project.rs#L355-L391","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":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}