pub struct WorkspaceManager { /* private fields */ }Expand description
A manager for workspace folders and path resolution.
Implementations§
Source§impl WorkspaceManager
impl WorkspaceManager
pub fn new() -> Self
Sourcepub fn initialize(&self, params: &InitializeParams)
pub fn initialize(&self, params: &InitializeParams)
Initialize the workspace manager with parameters from the client.
Sourcepub fn add_folder(&self, uri: String, _name: String)
pub fn add_folder(&self, uri: String, _name: String)
Add a workspace folder.
Sourcepub fn remove_folder(&self, uri: &str)
pub fn remove_folder(&self, uri: &str)
Remove a workspace folder.
Sourcepub fn get_path(&self, uri: &str) -> Option<PathBuf>
pub fn get_path(&self, uri: &str) -> Option<PathBuf>
Get the local path for a URI if it’s within a workspace folder.
Sourcepub fn path_to_uri(&self, path: PathBuf) -> Option<String>
pub fn path_to_uri(&self, path: PathBuf) -> Option<String>
Convert a local path to a file URI.
Sourcepub fn find_root(&self, uri: &str) -> Option<String>
pub fn find_root(&self, uri: &str) -> Option<String>
Find the workspace folder URI that contains the given URI.
Sourcepub fn is_within_workspace(&self, uri: &str) -> bool
pub fn is_within_workspace(&self, uri: &str) -> bool
Check if a URI is within any workspace folder.
Sourcepub fn list_folders(&self) -> Vec<(String, PathBuf)>
pub fn list_folders(&self) -> Vec<(String, PathBuf)>
List all workspace folders.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkspaceManager
impl !RefUnwindSafe for WorkspaceManager
impl Send for WorkspaceManager
impl Sync for WorkspaceManager
impl Unpin for WorkspaceManager
impl UnwindSafe for WorkspaceManager
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