{"record":{"id":"e406c7e364f3004d","repo":"zed-industries/zed","slug":"expected-an-integer","errorCode":null,"errorMessage":"expected an integer","messagePattern":"expected an integer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/snippet/src/snippet.rs","lineNumber":140,"sourceCode":"        source = rest;\n    }\n\n    tabstops\n        .entry(tabstop_index)\n        .or_insert_with(|| TabStop {\n            ranges: Default::default(),\n            choices,\n        })\n        .ranges\n        .push(tabstop_start as isize..text.len() as isize);\n    Ok(source)\n}\n\nfn parse_int(source: &str) -> Result<(usize, &str)> {\n    let len = source\n        .find(|c: char| !c.is_ascii_digit())\n        .unwrap_or(source.len());\n    anyhow::ensure!(len > 0, \"expected an integer\");\n    let (prefix, suffix) = source.split_at(len);\n    Ok((prefix.parse()?, suffix))\n}\n\nfn parse_choices<'a>(\n    mut source: &'a str,\n    text: &mut String,\n) -> Result<(&'a str, Option<Vec<String>>)> {\n    let mut found_default_choice = false;\n    let mut current_choice = String::new();\n    let mut choices = Vec::new();\n\n    loop {\n        match source.chars().next() {\n            None => return Ok((\"\", Some(choices))),\n            Some('\\\\') => {\n                source = &source[1..];\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/snippet/src/snippet.rs#L122-L158","documentation":"Raised in parse_int while parsing snippet tabstop syntax when the parser expects digits (e.g. after `${` or `:` in a placeholder/choice) but the next characters are not an ASCII digit. The tabstop index is missing or malformed, so the snippet parse fails at that offset.","triggerScenarios":"Thrown at crates/snippet/src/snippet.rs:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the snippet syntax: tabstops must be $0, $1, ${2:...} etc.","Remove stray $ or { characters"],"exampleFix":null,"handlingStrategy":"validation","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"}