pub struct Resolver { /* private fields */ }Expand description
Responsible for mapping to and from the virtual file system we present to AI agents where each workspace is in a root file system.
Implementations§
Source§impl Resolver
impl Resolver
Sourcepub fn new(workspace_roots: Vec<PathBuf>) -> Result<Self>
pub fn new(workspace_roots: Vec<PathBuf>) -> Result<Self>
Create a new PathResolver with the given workspace roots. Non-existent directories are skipped with a warning (handles VSCode multi-workspace deletion).
Sourcepub fn resolve_path(&self, path_str: &str) -> Result<ResolvedPath>
pub fn resolve_path(&self, path_str: &str) -> Result<ResolvedPath>
Resolves a path in the virtual file system to the real path on disk
Sourcepub fn canonicalize(&self, path: &Path) -> Result<ResolvedPath>
pub fn canonicalize(&self, path: &Path) -> Result<ResolvedPath>
Converts a real on disk path to the virtual file system path
pub fn root(&self, workspace: &str) -> Option<PathBuf>
pub fn roots(&self) -> Vec<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resolver
impl RefUnwindSafe for Resolver
impl Send for Resolver
impl Sync for Resolver
impl Unpin for Resolver
impl UnwindSafe for Resolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.