Fix ssh project history (#19683)
Use `Fs` instead of `std::fs` and do entry existence checks better: * first, check the worktree entry existence without any FS checks * then, only for local cases, use `Fs` to check for abs_path existence of items, in case those came from single-filed worktrees that got closed and removed. Remote entries do not get file existence checks, so might try opening previously removed buffers for now. Release Notes: - N/A
This commit is contained in:
parent
3ec015b325
commit
454d3dd52b
5 changed files with 80 additions and 52 deletions
|
@ -4,7 +4,7 @@ use super::*;
|
|||
use editor::Editor;
|
||||
use gpui::{Entity, TestAppContext, VisualTestContext};
|
||||
use menu::{Confirm, SelectNext, SelectPrev};
|
||||
use project::FS_WATCH_LATENCY;
|
||||
use project::{RemoveOptions, FS_WATCH_LATENCY};
|
||||
use serde_json::json;
|
||||
use workspace::{AppState, ToggleFileFinder, Workspace};
|
||||
|
||||
|
@ -1450,6 +1450,15 @@ async fn test_nonexistent_history_items_not_shown(cx: &mut gpui::TestAppContext)
|
|||
open_close_queried_buffer("non", 1, "nonexistent.rs", &workspace, cx).await;
|
||||
open_close_queried_buffer("thi", 1, "third.rs", &workspace, cx).await;
|
||||
open_close_queried_buffer("fir", 1, "first.rs", &workspace, cx).await;
|
||||
app_state
|
||||
.fs
|
||||
.remove_file(
|
||||
Path::new("/src/test/nonexistent.rs"),
|
||||
RemoveOptions::default(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
cx.run_until_parked();
|
||||
|
||||
let picker = open_file_picker(&workspace, cx);
|
||||
cx.simulate_input("rs");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue