logiguard fork: GPUI xdg-activation keyboard-focus serial fix
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Single-commit orphan branch: full zed-industries/zed @ 8c74db0 source tree with a 3-file patch applied (no upstream history). Patch (crates/gpui_linux/src/linux/wayland/): - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Mutter honors window activation only when the token carries the keyboard- focus serial from wl_keyboard.enter; GPUI used a stale mouse-press serial. See docs/tray-window-focus-wayland.md in logiguard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
114
crates/project/tests/integration/project_search.rs
Normal file
114
crates/project/tests/integration/project_search.rs
Normal file
@@ -0,0 +1,114 @@
|
||||
use std::{path::Path, sync::Arc};
|
||||
|
||||
use crate::init_test;
|
||||
use fs::FakeFs;
|
||||
use project::{Project, ProjectEntryId, project_search::PathInclusionMatcher, search::SearchQuery};
|
||||
use serde_json::json;
|
||||
use settings::Settings;
|
||||
use util::{
|
||||
path,
|
||||
paths::{PathMatcher, PathStyle},
|
||||
rel_path::RelPath,
|
||||
};
|
||||
use worktree::{Entry, EntryKind, WorktreeSettings};
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_path_inclusion_matcher(cx: &mut gpui::TestAppContext) {
|
||||
init_test(cx);
|
||||
|
||||
let fs = FakeFs::new(cx.background_executor.clone());
|
||||
fs.insert_tree(
|
||||
"/root",
|
||||
json!({
|
||||
".gitignore": "src/data/\n",
|
||||
"src": {
|
||||
"data": {
|
||||
"main.csv": "field_1,field_2,field_3",
|
||||
},
|
||||
"lib": {
|
||||
"main.txt": "Are you familiar with fields?",
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
.await;
|
||||
|
||||
let project = Project::test(fs.clone(), [path!("/root").as_ref()], cx).await;
|
||||
let worktree = project.update(cx, |project, cx| project.worktrees(cx).next().unwrap());
|
||||
let (worktree_settings, worktree_snapshot) = worktree.update(cx, |worktree, cx| {
|
||||
let settings_location = worktree.settings_location(cx);
|
||||
return (
|
||||
WorktreeSettings::get(Some(settings_location), cx).clone(),
|
||||
worktree.snapshot(),
|
||||
);
|
||||
});
|
||||
|
||||
// Manually create a test entry for the gitignored directory since it won't
|
||||
// be loaded by the worktree
|
||||
let entry = Entry {
|
||||
id: ProjectEntryId::from_proto(1),
|
||||
kind: EntryKind::UnloadedDir,
|
||||
path: Arc::from(RelPath::unix(Path::new("src/data")).unwrap()),
|
||||
inode: 0,
|
||||
mtime: None,
|
||||
canonical_path: None,
|
||||
is_ignored: true,
|
||||
is_hidden: false,
|
||||
is_always_included: false,
|
||||
is_external: false,
|
||||
is_private: false,
|
||||
size: 0,
|
||||
char_bag: Default::default(),
|
||||
is_fifo: false,
|
||||
};
|
||||
|
||||
// 1. Test searching for `field`, including ignored files without any
|
||||
// inclusion and exclusion filters.
|
||||
let include_ignored = true;
|
||||
let files_to_include = PathMatcher::default();
|
||||
let files_to_exclude = PathMatcher::default();
|
||||
let match_full_paths = false;
|
||||
let search_query = SearchQuery::text(
|
||||
"field",
|
||||
false,
|
||||
false,
|
||||
include_ignored,
|
||||
files_to_include,
|
||||
files_to_exclude,
|
||||
match_full_paths,
|
||||
None,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let path_matcher = PathInclusionMatcher::new(Arc::new(search_query));
|
||||
assert!(path_matcher.should_scan_gitignored_dir(
|
||||
&entry,
|
||||
&worktree_snapshot,
|
||||
&worktree_settings
|
||||
));
|
||||
|
||||
// 2. Test searching for `field`, including ignored files but updating
|
||||
// `files_to_include` to only include files under `src/lib`.
|
||||
let include_ignored = true;
|
||||
let files_to_include = PathMatcher::new(vec!["src/lib"], PathStyle::Posix).unwrap();
|
||||
let files_to_exclude = PathMatcher::default();
|
||||
let match_full_paths = false;
|
||||
let search_query = SearchQuery::text(
|
||||
"field",
|
||||
false,
|
||||
false,
|
||||
include_ignored,
|
||||
files_to_include,
|
||||
files_to_exclude,
|
||||
match_full_paths,
|
||||
None,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let path_matcher = PathInclusionMatcher::new(Arc::new(search_query));
|
||||
assert!(!path_matcher.should_scan_gitignored_dir(
|
||||
&entry,
|
||||
&worktree_snapshot,
|
||||
&worktree_settings
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user