zed-industries/zed · error

Unsupported mention URI type for paste

Error message

Unsupported mention URI type for paste

What it means

Catch-all guard in confirm_mention_for_uri reached when a mention URI variant has no paste conversion path (any URI kind not handled by the preceding match arms). It signals that the mention type is structurally unsupported for paste, rather than a problem with the specific input; the offending input is the unhandled MentionUri variant.

Solutions

  1. Use a supported mention type for paste (file, selection in a saved buffer, skill, directory, rule, thread, diagnostics, git diff)
  2. Copy the mention's underlying content manually instead of pasting the mention
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/agent_ui/src/mention_set.rs:171 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/e9259528d2cf2ab6. Report an issue: GitHub.

Appendix: source

Thrown at crates/agent_ui/src/mention_set.rs:171

                include_errors,
                include_warnings,
            } => self.confirm_mention_for_diagnostics(include_errors, include_warnings, cx),
            MentionUri::GitDiff { base_ref } => {
                self.confirm_mention_for_git_diff(base_ref.into(), cx)
            }
            MentionUri::Selection {
                abs_path: Some(abs_path),
                line_range,
                ..
            } => self.confirm_mention_for_symbol(abs_path, line_range, cx),
            MentionUri::Selection { abs_path: None, .. } => Task::ready(Err(anyhow!(
                "Untitled buffer selection mentions are not supported for paste"
            ))),
            MentionUri::PastedImage { .. }
            | MentionUri::TerminalSelection { .. }
            | MentionUri::MergeConflict { .. }
            | MentionUri::Rule { .. } => {
                Task::ready(Err(anyhow!("Unsupported mention URI type for paste")))
            }
        }
    }

    pub fn remove_mention(&mut self, crease_id: &CreaseId, cx: &mut App) {
        self.mentions.remove(crease_id);
        self.crease_entities.remove(crease_id);
        self.recompute_disambiguation(cx);
    }

    pub fn creases(&self) -> HashSet<CreaseId> {
        self.mentions.keys().cloned().collect()
    }

    pub fn is_empty(&self) -> bool {
        self.mentions.is_empty()
    }

View on GitHub (pinned to f4178619ac)