{"record":{"id":"0749206ada9e048a","repo":"zed-industries/zed","slug":"missing-python-semantic-token-rules-json","errorCode":null,"errorMessage":"missing python/semantic_token_rules.json","messagePattern":"missing python/semantic_token_rules\\.json","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/languages/src/python.rs","lineNumber":57,"sourceCode":"use util::paths::PathStyle;\nuse util::rel_path::RelPath;\n\nuse http_client::github_download::{GithubBinaryMetadata, download_server_binary};\nuse parking_lot::Mutex;\nuse std::str::FromStr;\nuse std::{\n    borrow::Cow,\n    fmt::Write,\n    future::Future,\n    path::{Path, PathBuf},\n    sync::Arc,\n};\nuse task::{ShellKind, TaskTemplate, TaskTemplates, VariableName};\nuse util::{ResultExt, maybe};\n\npub(crate) fn semantic_token_rules() -> SemanticTokenRules {\n    let content = grammars::get_file(\"python/semantic_token_rules.json\")\n        .expect(\"missing python/semantic_token_rules.json\");\n    let json = std::str::from_utf8(&content.data).expect(\"invalid utf-8 in semantic_token_rules\");\n    settings::parse_json_with_comments::<SemanticTokenRules>(json)\n        .expect(\"failed to parse python semantic_token_rules.json\")\n}\n\n#[derive(Debug, Serialize, Deserialize)]\npub(crate) struct PythonToolchainData {\n    #[serde(flatten)]\n    environment: PythonEnvironment,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    activation_scripts: Option<HashMap<ShellKind, PathBuf>>,\n}\n\npub(crate) struct PyprojectTomlManifestProvider;\n\nimpl ManifestProvider for PyprojectTomlManifestProvider {\n    fn name(&self) -> ManifestName {\n        SharedString::new_static(\"pyproject.toml\").into()","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/languages/src/python.rs#L39-L75","documentation":"Panics because grammars::get_file(\"python/semantic_token_rules.json\") returned None: the Python semantic-token rules asset is missing from the compiled-in grammars files. As with the other languages, this is a packaging invariant — the vendored file was not embedded, not a runtime condition.","triggerScenarios":"Thrown at crates/languages/src/python.rs:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the python asset is present in the grammars crate's embedded file list and rebuild","Add a test asserting get_file succeeds for every language's rules file","Return default empty rules with a warning instead of panicking"],"exampleFix":null,"handlingStrategy":"fallback","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"}