pub trait WorkSpaceProvider:
Environment
+ Send
+ Sync {
// Required methods
fn GetWorkSpaceFoldersInfo<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Url, String, usize)>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetWorkSpaceFolderInfo<'life0, 'async_trait>(
&'life0 self,
URIToMatch: Url,
) -> Pin<Box<dyn Future<Output = Result<Option<(Url, String, usize)>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetWorkSpaceName<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetWorkSpaceConfigurationPath<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn IsWorkSpaceTrusted<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn RequestWorkSpaceTrust<'life0, 'async_trait>(
&'life0 self,
Options: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<bool, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn FindFilesInWorkSpace<'life0, 'async_trait>(
&'life0 self,
IncludePatternDTO: Value,
ExcludePatternDTO: Option<Value>,
MaxResults: Option<usize>,
UseIgnoreFiles: bool,
FollowSymlinks: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Url>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn OpenFile<'life0, 'async_trait>(
&'life0 self,
Path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An abstract service contract for an environment component that can provide information about the current workspace.
This trait is the primary interface for interacting with workspace folders, configuration paths, trust settings, and for performing workspace-wide operations like finding files.
Required Methods§
Sourcefn GetWorkSpaceFoldersInfo<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Url, String, usize)>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn GetWorkSpaceFoldersInfo<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Url, String, usize)>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves information about all currently open workspace folders.
§Returns
A Result containing a vector of tuples, where each tuple is
(FolderURI, FolderName, FolderIndex).
Sourcefn GetWorkSpaceFolderInfo<'life0, 'async_trait>(
&'life0 self,
URIToMatch: Url,
) -> Pin<Box<dyn Future<Output = Result<Option<(Url, String, usize)>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn GetWorkSpaceFolderInfo<'life0, 'async_trait>(
&'life0 self,
URIToMatch: Url,
) -> Pin<Box<dyn Future<Output = Result<Option<(Url, String, usize)>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves information for the specific workspace folder that contains the given URI.
§Parameters
URIToMatch: The URI to find the containing folder for.
Sourcefn GetWorkSpaceName<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn GetWorkSpaceName<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the name of the current workspace.
Sourcefn GetWorkSpaceConfigurationPath<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn GetWorkSpaceConfigurationPath<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the path to the workspace configuration file (e.g., a
.code-workspace file), if one exists.
Sourcefn IsWorkSpaceTrusted<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn IsWorkSpaceTrusted<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if the current workspace is trusted by the user.
Sourcefn RequestWorkSpaceTrust<'life0, 'async_trait>(
&'life0 self,
Options: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<bool, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn RequestWorkSpaceTrust<'life0, 'async_trait>(
&'life0 self,
Options: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<bool, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prompts the user to grant or deny trust to the current workspace.
§Parameters
Options: Optional DTO with further information for the trust prompt.
Sourcefn FindFilesInWorkSpace<'life0, 'async_trait>(
&'life0 self,
IncludePatternDTO: Value,
ExcludePatternDTO: Option<Value>,
MaxResults: Option<usize>,
UseIgnoreFiles: bool,
FollowSymlinks: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Url>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn FindFilesInWorkSpace<'life0, 'async_trait>(
&'life0 self,
IncludePatternDTO: Value,
ExcludePatternDTO: Option<Value>,
MaxResults: Option<usize>,
UseIgnoreFiles: bool,
FollowSymlinks: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Url>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Finds files within the workspace matching the given criteria.
§Parameters
IncludePatternDTO: A DTO representing the glob pattern to include.ExcludePatternDTO: An optional DTO for files/folders to exclude.MaxResults: An optional limit on the number of results to return.UseIgnoreFiles: Whether to respect.gitignore-style ignore files.FollowSymlinks: Whether to follow symbolic links during the search.