Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Revert "workspace: Fix edge case when saving workspace with no paths" (#54688)
Yara 🏳️⚧️c7dd199a85d2
diff --git a/crates/workspace/src/persistence.rs b/crates/workspace/src/persistence.rsindex 488cdcce506..7248abe9b8d 100644--- a/crates/workspace/src/persistence.rs+++ b/crates/workspace/src/persistence.rs@@ -1529,21 +1529,6 @@ impl WorkspaceDb {.context("clearing out old locations")?;}- // If there are no paths in the workspace, make sure to save- // paths as NULL in the database, not as an empty string.- // Otherwise, the workspace may fail to restore, potentially- // losing any unsaved buffers.- let maybe_paths = if !paths.paths.is_empty() {- Some(paths.paths.clone())- } else {- None- };- let maybe_order = if !paths.order.is_empty() {- Some(paths.order.clone())- } else {- None- };-// Upsertlet query = sql!(INSERT INTO workspaces(@@ -1586,8 +1571,8 @@ impl WorkspaceDb {let mut prepared_query = conn.exec_bound(query)?;let args = (workspace.id,- maybe_paths,- maybe_order,+ paths.paths.clone(),+ paths.order.clone(),remote_connection_id,workspace.docks,workspace.session_id,