Rebuilt from the exact zed-industries/zed @ 8c74db00c4053d6c0a9037863d7bd048658da4ca tree (previous orphan was based on a stale/wrong fetch). Same 3-file patch: - 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) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
29 lines
1.1 KiB
Rust
29 lines
1.1 KiB
Rust
use std::sync::Arc;
|
|
|
|
use settings::WorktreeId;
|
|
use util::rel_path::RelPath;
|
|
|
|
// Re-export ManifestName from language_core.
|
|
pub use language_core::ManifestName;
|
|
|
|
/// Represents a manifest query; given a path to a file, the manifest provider is tasked with finding a path to the directory containing the manifest for that file.
|
|
///
|
|
/// Since parts of the path might have already been explored, there's an additional `depth` parameter that indicates to what ancestry level a given path should be explored.
|
|
/// For example, given a path like `foo/bar/baz`, a depth of 2 would explore `foo/bar/baz` and `foo/bar`, but not `foo`.
|
|
pub struct ManifestQuery {
|
|
/// Path to the file, relative to worktree root.
|
|
pub path: Arc<RelPath>,
|
|
pub depth: usize,
|
|
pub delegate: Arc<dyn ManifestDelegate>,
|
|
}
|
|
|
|
pub trait ManifestProvider {
|
|
fn name(&self) -> ManifestName;
|
|
fn search(&self, query: ManifestQuery) -> Option<Arc<RelPath>>;
|
|
}
|
|
|
|
pub trait ManifestDelegate: Send + Sync {
|
|
fn worktree_id(&self) -> WorktreeId;
|
|
fn exists(&self, path: &RelPath, is_dir: Option<bool>) -> bool;
|
|
}
|