mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-21 05:31:11 +00:00
Tree-sitter input callbacks receive byte offsets, which can fall inside a UTF-8 character. Both language parser entry points previously sought to that offset, sliced the rope chunk as `str`, and only then converted it to bytes. This could panic while reparsing after an agent edit. - Add `Chunks::peek_bytes` and use it in both parser callbacks, preserving the exact requested offset without allocating or rounding to a character boundary. - Share the chunk slice-range computation with string and bitmap peeks, preserving their existing UTF-8 requirements. Document that constructing a `Chunks` cursor still requires an aligned initial offset. - Use `Rope::bytes_in_range` for query text providers and add a query-predicate regression for error nodes starting inside multibyte characters. - Add parser regressions for two-, three-, and four-byte characters and nonzero syntax-layer origins; compare results with parsing contiguous bytes. - Exercise forward/reverse seeks across rope chunks, bounded ranges starting or ending inside characters, and EOF/empty input. Release Notes: - Fixed a crash when syntax parsing requested bytes inside a multibyte character. |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||