Fix excluded file creation (#12620)

Fixes https://github.com/zed-industries/zed/issues/10890

* removes `unwrap()` that caused panics for text elements with no text,
remaining after edit state is cleared but project entries are not
updated, having the fake, "new entry"
* improves discoverability of the FS errors during file/directory
creation: now those are shown as workspace notifications
* stops printing anyhow backtraces in workspace notifications, printing
the more readable chain of contexts instead
* better indicates when new entries are created as excluded ones


Release Notes:

- Improve excluded entry creation workflow in the project panel
([10890](https://github.com/zed-industries/zed/issues/10890))
This commit is contained in:
Kirill Bulatov 2024-06-04 10:31:43 +03:00 committed by GitHub
parent edd613062a
commit 47122a3115
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 447 additions and 58 deletions

View file

@ -3022,7 +3022,6 @@ async fn test_fs_operations(
let project_b = client_b.build_dev_server_project(project_id, cx_b).await;
let worktree_a = project_a.read_with(cx_a, |project, _| project.worktrees().next().unwrap());
let worktree_b = project_b.read_with(cx_b, |project, _| project.worktrees().next().unwrap());
let entry = project_b
@ -3031,6 +3030,7 @@ async fn test_fs_operations(
})
.await
.unwrap()
.to_included()
.unwrap();
worktree_a.read_with(cx_a, |worktree, _| {
@ -3059,6 +3059,7 @@ async fn test_fs_operations(
})
.await
.unwrap()
.to_included()
.unwrap();
worktree_a.read_with(cx_a, |worktree, _| {
@ -3087,6 +3088,7 @@ async fn test_fs_operations(
})
.await
.unwrap()
.to_included()
.unwrap();
worktree_a.read_with(cx_a, |worktree, _| {
@ -3115,20 +3117,25 @@ async fn test_fs_operations(
})
.await
.unwrap()
.to_included()
.unwrap();
project_b
.update(cx_b, |project, cx| {
project.create_entry((worktree_id, "DIR/SUBDIR"), true, cx)
})
.await
.unwrap()
.to_included()
.unwrap();
project_b
.update(cx_b, |project, cx| {
project.create_entry((worktree_id, "DIR/SUBDIR/f.txt"), false, cx)
})
.await
.unwrap()
.to_included()
.unwrap();
worktree_a.read_with(cx_a, |worktree, _| {