zed-industries/zed · error

can't convert URI to path

Error message

can't convert URI to path

What it means

While applying code-action/workspace-edit operations, an LSP edit's document URI could not be converted to a local file path (non-file scheme or malformed URI), so the edit cannot be applied to a buffer.

Source

Thrown at crates/project/src/lsp_store.rs:3697

            Ok(edits)
        })
    }

    pub(crate) async fn deserialize_workspace_edit(
        this: Entity<LspStore>,
        edit: lsp::WorkspaceEdit,
        push_to_history: bool,
        language_server: Arc<LanguageServer>,
        cx: &mut AsyncApp,
    ) -> Result<ProjectTransaction> {
        let fs = this.read_with(cx, |this, _| this.as_local().unwrap().fs.clone());

        let mut operations = Vec::new();
        if let Some(document_changes) = edit.document_changes {
            match document_changes {
                lsp::DocumentChanges::Edits(edits) => {
                    operations.extend(edits.into_iter().map(lsp::DocumentChangeOperation::Edit))
                }
                lsp::DocumentChanges::Operations(ops) => operations = ops,
            }
        } else if let Some(changes) = edit.changes {
            operations.extend(changes.into_iter().map(|(uri, edits)| {
                lsp::DocumentChangeOperation::Edit(lsp::TextDocumentEdit {
                    text_document: lsp::OptionalVersionedTextDocumentIdentifier {
                        uri,
                        version: None,
                    },
                    edits: edits.into_iter().map(Edit::Plain).collect(),
                })
            }));
        }

        let mut project_transaction = ProjectTransaction::default();
        for operation in operations {
            match operation {
                lsp::DocumentChangeOperation::Op(lsp::ResourceOp::Create(op)) => {

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Report the unsupported URI to the language server maintainers
  2. Ensure the language server emits file:// URIs for editable documents
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/project/src/lsp_store.rs:3538 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/e743de5a9d9b9683. Report an issue: GitHub.