mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 20:35:20 +00:00
* refactor: for query * refactor: for diag * feat: lazy hash expr info * feat: hash resolves * fix: update snapshot
19 lines
569 B
Rust
19 lines
569 B
Rust
use tinymist_project::LspCompiledArtifact;
|
|
|
|
use crate::{prelude::*, DiagWorker, DiagnosticsMap, SemanticRequest};
|
|
|
|
/// A request to check the document for errors and lints.
|
|
#[derive(Clone)]
|
|
pub struct CheckRequest {
|
|
/// The compilation result of the document.
|
|
pub snap: LspCompiledArtifact,
|
|
}
|
|
|
|
impl SemanticRequest for CheckRequest {
|
|
type Response = DiagnosticsMap;
|
|
|
|
fn request(self, ctx: &mut LocalContext) -> Option<Self::Response> {
|
|
let worker = DiagWorker::new(ctx);
|
|
Some(worker.check().convert_all(self.snap.diagnostics()))
|
|
}
|
|
}
|