mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 20:35:20 +00:00
feat: feed more information to linter (#1642)
* feat: move expr struct to common crate * feat: feed more information to linter
This commit is contained in:
parent
fcb060280d
commit
6cf7739fb6
10 changed files with 205 additions and 202 deletions
|
|
@ -4,7 +4,7 @@ use tinymist_project::LspWorld;
|
|||
use tinymist_world::vfs::WorkspaceResolver;
|
||||
use typst::{diag::SourceDiagnostic, syntax::Span};
|
||||
|
||||
use crate::{analysis::Analysis, prelude::*, LspWorldExt};
|
||||
use crate::{analysis::Analysis, prelude::*, syntax::ExprInfo, LspWorldExt};
|
||||
|
||||
use regex::RegexSet;
|
||||
|
||||
|
|
@ -56,7 +56,8 @@ impl<'w> DiagWorker<'w> {
|
|||
let Ok(source) = self.ctx.world.source(dep) else {
|
||||
continue;
|
||||
};
|
||||
let res = lint_source(&source);
|
||||
let expr = self.ctx.expr_stage(&source);
|
||||
let res = lint_file(&expr);
|
||||
if !res.is_empty() {
|
||||
for diag in res {
|
||||
self.handle(&diag);
|
||||
|
|
@ -245,6 +246,6 @@ impl DiagnosticRefiner for OutOfRootHintRefiner {
|
|||
}
|
||||
|
||||
#[comemo::memoize]
|
||||
fn lint_source(source: &Source) -> EcoVec<SourceDiagnostic> {
|
||||
fn lint_file(source: &ExprInfo) -> EcoVec<SourceDiagnostic> {
|
||||
tinymist_lint::lint_source(source)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue