{"record":{"id":"edd52adc6875b8af","repo":"zed-industries/zed","slug":"missing-rust-semantic-token-rules-json","errorCode":null,"errorMessage":"missing rust/semantic_token_rules.json","messagePattern":"missing rust/semantic_token_rules\\.json","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/languages/src/rust.rs","lineNumber":40,"sourceCode":"use std::future::Future;\nuse std::ops::Range;\nuse std::{\n    borrow::Cow,\n    path::{Path, PathBuf},\n    sync::{Arc, LazyLock},\n};\nuse task::{TaskTemplate, TaskTemplates, TaskVariables, VariableName};\nuse util::command::{Stdio, new_command};\nuse util::fs::{make_file_executable, remove_matching};\nuse util::merge_json_value_into;\nuse util::rel_path::RelPath;\nuse util::{ResultExt, maybe};\n\nuse crate::language_settings::LanguageSettings;\n\npub(crate) fn semantic_token_rules() -> SemanticTokenRules {\n    let content = grammars::get_file(\"rust/semantic_token_rules.json\")\n        .expect(\"missing rust/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 rust semantic_token_rules.json\")\n}\n\npub struct RustLspAdapter;\n\n#[cfg(target_os = \"macos\")]\nimpl RustLspAdapter {\n    const GITHUB_ASSET_KIND: AssetKind = AssetKind::Gz;\n    const ARCH_SERVER_NAME: &str = \"apple-darwin\";\n}\n\n#[cfg(target_os = \"linux\")]\nimpl RustLspAdapter {\n    const GITHUB_ASSET_KIND: AssetKind = AssetKind::Gz;\n    const ARCH_SERVER_NAME: &str = \"unknown-linux\";\n}","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/languages/src/rust.rs#L22-L58","documentation":"Panics because grammars::get_file(\"rust/semantic_token_rules.json\") returned None: the Rust semantic-token rules asset was not found among the embedded grammar files. This is a build invariant — the vendored file missing from the binary indicates a packaging/build problem, not user input.","triggerScenarios":"Thrown at crates/languages/src/rust.rs:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure rust/semantic_token_rules.json is in the embedded assets and rebuild the grammars crate","Add a test enumerating expected language asset files","Return default empty rules with a logged warning instead of panicking"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}