pub trait DiagnosticManager:
Environment
+ Send
+ Sync {
// Required methods
fn SetDiagnostics<'life0, 'async_trait>(
&'life0 self,
Owner: String,
EntriesDTOValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ClearDiagnostics<'life0, 'async_trait>(
&'life0 self,
Owner: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetAllDiagnostics<'life0, 'async_trait>(
&'life0 self,
ResourceURIFilterOption: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An abstract service contract for an environment component that can manage diagnostic collections.
Diagnostics are problems detected in the workspace, such as compiler errors or linter warnings. They are typically owned by a source (e.g., a “typescript-linter”) and associated with specific resource URIs.
Required Methods§
Sourcefn SetDiagnostics<'life0, 'async_trait>(
&'life0 self,
Owner: String,
EntriesDTOValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SetDiagnostics<'life0, 'async_trait>(
&'life0 self,
Owner: String,
EntriesDTOValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets or updates diagnostics for multiple resources from a specific owner.
§Parameters
Owner: A string identifying the source of the diagnostics (e.g., “cocoon-diag-0-typescript”).EntriesDTOValue: Aserde_json::Valuethat deserializes into an array of tuples. Each tuple has the shape[UriComponentsDTO, Option<Vec<MarkerDataDTO>>]. To clear diagnostics for a resource, provideNoneor an empty vector for its entry.
Sourcefn ClearDiagnostics<'life0, 'async_trait>(
&'life0 self,
Owner: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ClearDiagnostics<'life0, 'async_trait>(
&'life0 self,
Owner: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears all diagnostics that were previously reported by a specific owner.
§Parameters
Owner: The identifier of the diagnostic source to clear.
Sourcefn GetAllDiagnostics<'life0, 'async_trait>(
&'life0 self,
ResourceURIFilterOption: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn GetAllDiagnostics<'life0, 'async_trait>(
&'life0 self,
ResourceURIFilterOption: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves all diagnostics currently in the system, with an option to filter by a specific resource URI.
§Parameters
ResourceURIFilterOption: An optionalserde_json::Valuerepresenting aUriComponentsDTO. IfSome, only diagnostics for that specific URI are returned. IfNone, all diagnostics are returned.
§Returns
A serde_json::Value representing an array of tuples:
Vec<[UriComponentsDTO, Vec<MarkerDataDTO>]>.