{"record":{"id":"80570cf7d0b9bd7f","repo":"zed-industries/zed","slug":"missing-go-semantic-token-rules-json","errorCode":null,"errorMessage":"missing go/semantic_token_rules.json","messagePattern":"missing go/semantic_token_rules\\.json","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/languages/src/go.rs","lineNumber":37,"sourceCode":"use std::{\n    borrow::Cow,\n    ffi::{OsStr, OsString},\n    future::Future,\n    ops::Range,\n    path::{Path, PathBuf},\n    process::Output,\n    str,\n    sync::{\n        Arc, LazyLock,\n        atomic::{AtomicBool, Ordering::SeqCst},\n    },\n};\nuse task::{TaskTemplate, TaskTemplates, TaskVariables, VariableName};\nuse util::{ResultExt, fs::remove_matching, maybe, merge_json_value_into};\n\npub(crate) fn semantic_token_rules() -> SemanticTokenRules {\n    let content = grammars::get_file(\"go/semantic_token_rules.json\")\n        .expect(\"missing go/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 go semantic_token_rules.json\")\n}\n\nfn server_binary_arguments() -> Vec<OsString> {\n    vec![\"-mode=stdio\".into()]\n}\n\n#[derive(Copy, Clone)]\npub struct GoLspAdapter;\n\nimpl GoLspAdapter {\n    const SERVER_NAME: LanguageServerName = LanguageServerName::new_static(\"gopls\");\n}\n\nstatic VERSION_REGEX: LazyLock<Regex> =\n    LazyLock::new(|| Regex::new(r\"\\d+\\.\\d+\\.\\d+\").expect(\"Failed to create VERSION_REGEX\"));","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/languages/src/go.rs#L19-L55","documentation":"Panics because grammars::get_file(\"go/semantic_token_rules.json\") returned None: the Go semantic-token rules asset was not compiled into the binary. This is a build/packaging invariant — the file is vendored, so its absence means the grammars assets were not properly included, not that the user misconfigured anything.","triggerScenarios":"Thrown at crates/languages/src/go.rs:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm go/semantic_token_rules.json exists in the grammars sources and is listed in embedded assets","Rebuild so the asset is re-embedded","Return default empty rules with a log warning instead of panicking on a missing asset"],"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-14T05:17:10.506Z"}