zed-industries/zed · error

just put them in

Error message

just put them in

What it means

An assertion in matches_to_multibuffer that match ranges/excerpts for a buffer were inserted ('just put them in'); it fires when the expected excerpts were not added to the multibuffer, indicating an ordering or filtering bug during project search population.

Source

Thrown at crates/search/src/text_finder/delegate.rs:682

    let search_id = project_search_view.update(cx, |view, cx| {
        view.entity.update(cx, |search, _| {
            search.match_ranges.clear();
            search.search_id
        })
    });

    let context_lines = cx.update(|cx| multibuffer_context_lines(cx));

    let still_current = |cx: &mut AsyncApp| {
        project_search_view.update(cx, |view, cx| view.entity.read(cx).search_id == search_id)
    };

    let mut excerpts_added = 0;
    for buffer_id in buffer_order_in_text_finder {
        if !still_current(cx) {
            return PopulateProjectSearch::SupersededByNewSearch;
        }
        let (buffer, ranges) = by_buffer.remove(&buffer_id).expect("just put them in");
        excerpts_added += ranges.len();
        let new_ranges = excerpts
            .update(cx, |excerpts, cx| {
                excerpts.set_anchored_excerpts_for_path(
                    PathKey::for_buffer(&buffer, cx),
                    buffer,
                    ranges,
                    context_lines,
                    cx,
                )
            })
            .await;

        if !still_current(cx) {
            return PopulateProjectSearch::SupersededByNewSearch;
        }
        project_search_view.update(cx, |view, cx| {
            view.entity.update(cx, |search, cx| {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Verify excerpt insertion for each buffer in buffer_order_in_text_finder
  2. Check match ranges are non-empty and valid before insertion
  3. Return a partial result instead of asserting on population state
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/search/src/text_finder/delegate.rs:682 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/fad572615023dfd2. Report an issue: GitHub.