mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 20:35:20 +00:00
feat: simple lint types comparing with strings (#1643)
* feat: simple lint types comparing with strings * dev: edit message * fix: message
This commit is contained in:
parent
23f10a2648
commit
4265bc25bc
10 changed files with 170 additions and 13 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
use tinymist_analysis::ty::TypeInfo;
|
||||
use tinymist_project::LspWorld;
|
||||
use tinymist_world::vfs::WorkspaceResolver;
|
||||
use typst::{diag::SourceDiagnostic, syntax::Span};
|
||||
|
|
@ -57,7 +58,8 @@ impl<'w> DiagWorker<'w> {
|
|||
continue;
|
||||
};
|
||||
let expr = self.ctx.expr_stage(&source);
|
||||
let res = lint_file(&expr);
|
||||
let ti = self.ctx.type_check(&source);
|
||||
let res = lint_file(&expr, ti);
|
||||
if !res.is_empty() {
|
||||
for diag in res {
|
||||
self.handle(&diag);
|
||||
|
|
@ -246,6 +248,6 @@ impl DiagnosticRefiner for OutOfRootHintRefiner {
|
|||
}
|
||||
|
||||
#[comemo::memoize]
|
||||
fn lint_file(source: &ExprInfo) -> EcoVec<SourceDiagnostic> {
|
||||
tinymist_lint::lint_file(source)
|
||||
fn lint_file(source: &ExprInfo, ti: Arc<TypeInfo>) -> EcoVec<SourceDiagnostic> {
|
||||
tinymist_lint::lint_file(source, ti)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue