docs: refactor and documenting analyzer code (#44)

* dev: refactor and documenting analyzer code

* dev: documenting some lsp api
This commit is contained in:
Myriad-Dreamin 2024-03-16 02:54:56 +08:00 committed by GitHub
parent da7028f59c
commit 2d2857e6f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 381 additions and 259 deletions

View file

@ -1,10 +1,12 @@
mod adt;
pub mod analysis;
pub mod syntax;
pub(crate) mod diagnostics;
use std::sync::Arc;
pub use analysis::AnalysisContext;
use typst_ts_core::TypstDocument;
pub use diagnostics::*;
@ -54,6 +56,12 @@ pub struct VersionedDocument {
pub document: Arc<TypstDocument>,
}
pub trait SyntaxRequest {
type Response;
fn request(self, ctx: &mut AnalysisContext) -> Option<Self::Response>;
}
mod polymorphic {
use super::prelude::*;
use super::*;