zed-industries/zed · error
missing python/semantic_token_rules.json
Error message
missing python/semantic_token_rules.json
What it means
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.
Source
Thrown at crates/languages/src/python.rs:57
use util::paths::PathStyle;
use util::rel_path::RelPath;
use http_client::github_download::{GithubBinaryMetadata, download_server_binary};
use parking_lot::Mutex;
use std::str::FromStr;
use std::{
borrow::Cow,
fmt::Write,
future::Future,
path::{Path, PathBuf},
sync::Arc,
};
use task::{ShellKind, TaskTemplate, TaskTemplates, VariableName};
use util::{ResultExt, maybe};
pub(crate) fn semantic_token_rules() -> SemanticTokenRules {
let content = grammars::get_file("python/semantic_token_rules.json")
.expect("missing python/semantic_token_rules.json");
let json = std::str::from_utf8(&content.data).expect("invalid utf-8 in semantic_token_rules");
settings::parse_json_with_comments::<SemanticTokenRules>(json)
.expect("failed to parse python semantic_token_rules.json")
}
#[derive(Debug, Serialize, Deserialize)]
pub(crate) struct PythonToolchainData {
#[serde(flatten)]
environment: PythonEnvironment,
#[serde(skip_serializing_if = "Option::is_none")]
activation_scripts: Option<HashMap<ShellKind, PathBuf>>,
}
pub(crate) struct PyprojectTomlManifestProvider;
impl ManifestProvider for PyprojectTomlManifestProvider {
fn name(&self) -> ManifestName {
SharedString::new_static("pyproject.toml").into()View on GitHub (pinned to f4178619ac)
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/languages/src/python.rs:57 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/0749206ada9e048a.
Report an issue: GitHub.