{"record":{"id":"9918d4f104b30591","repo":"zed-industries/zed","slug":"grammar-in-indent-match-set-has-indents-config","errorCode":null,"errorMessage":"grammar in indent match set has indents_config","messagePattern":"grammar in indent match set has indents_config","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/language/src/buffer.rs","lineNumber":3696,"sourceCode":"    pub fn indent_size_for_line(&self, row: u32) -> IndentSize {\n        indent_size_for_line(self, row)\n    }\n\n    /// The indentation that the block comment closed on `position`'s row belongs\n    /// at, or `None` if that row is not the closing line of a multi-line block\n    /// comment.\n    ///\n    /// A closing delimiter is conventionally indented one column past its opening\n    /// delimiter, so that it lines up with the comment's prefixes:\n    ///\n    /// ```text\n    /// /**\n    ///  * doc\n    ///  */\n    /// ```\n    ///\n    /// That extra column belongs to the comment rather than to the surrounding\n    /// code, which makes the closing row's own indentation a poor basis for\n    /// indenting whatever follows it. The opening row's indentation is used\n    /// instead.\n    ///\n    /// Requires the row to hold nothing but whitespace and the closing delimiter,\n    /// and `position` to be at or past the end of that delimiter, so that\n    /// splitting the delimiter itself is left alone. Also requires the syntax node\n    /// containing the delimiter to end there, so that a line which merely looks\n    /// like a closing delimiter is not mistaken for one.\n    pub fn block_comment_closing_indent(&self, position: Point) -> Option<IndentSize> {\n        let row = position.row;\n        let indent_len = self.indent_size_for_line(row).len;\n        let delimiter_start = Point::new(row, indent_len);\n        let language = self.language_scope_at(delimiter_start)?;\n        // A few languages describe a string literal in `block_comment` rather\n        // than a comment (Python's `\"\"\"`), so either scope is accepted. Relying\n        // on the override scope keeps this out of the business of guessing at\n        // grammar node names.\n        if !matches!(language.override_name(), Some(\"comment\" | \"string\")) {","sourceCodeStart":3678,"sourceCodeEnd":3714,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/language/src/buffer.rs#L3678-L3714","documentation":"Asserts that every grammar appearing in a tree-sitter indent query match actually has an indents_config. The matches iterator was built with a closure that filters grammars to those having an indents_config, so a grammar reaching the later map without one violates that invariant — effectively a logic error in how matches_with_options filters versus how results are consumed.","triggerScenarios":"Thrown at crates/language/src/buffer.rs:3681 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Filter grammars consistently: skip grammars whose indents_config is None in the consumption loop too","Verify the grammar registry loaded indent queries for all grammars participating in the buffer","Replace the unwrap with a flat_map over indents_config.as_ref() to make absence a no-op"],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}