refactor: move expr and ty defs to analysis crate (#1633)

This commit is contained in:
Myriad-Dreamin 2025-04-08 05:50:55 +08:00 committed by GitHub
parent 72e33e461d
commit ac506dcc31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 968 additions and 890 deletions

View file

@ -8,6 +8,9 @@ use comemo::{Track, Tracked};
use lsp_types::Url;
use parking_lot::Mutex;
use rustc_hash::FxHashMap;
use tinymist_analysis::stats::AllocStats;
use tinymist_analysis::ty::term_value;
use tinymist_analysis::{analyze_expr_, analyze_import_};
use tinymist_project::LspWorld;
use tinymist_std::hash::{hash128, FxDashMap};
use tinymist_std::typst::TypstDocument;
@ -24,10 +27,9 @@ use typst_shim::eval::{eval_compat, Eval};
use crate::adt::revision::{RevisionLock, RevisionManager, RevisionManagerLike, RevisionSlot};
use crate::analysis::prelude::*;
use crate::analysis::{
analyze_expr_, analyze_import_, analyze_signature, bib_info, definition, post_type_check,
AllocStats, AnalysisStats, BibInfo, CompletionFeat, Definition, PathPreference, QueryStatGuard,
SemanticTokenCache, SemanticTokenContext, SemanticTokens, Signature, SignatureTarget, Ty,
TypeInfo,
analyze_signature, bib_info, definition, post_type_check, AnalysisStats, BibInfo,
CompletionFeat, Definition, PathPreference, QueryStatGuard, SemanticTokenCache,
SemanticTokenContext, SemanticTokens, Signature, SignatureTarget, Ty, TypeInfo,
};
use crate::docs::{DefDocs, TidyModuleDocs};
use crate::syntax::{
@ -147,7 +149,7 @@ impl Analysis {
/// Report the statistics of the allocation.
pub fn report_alloc_stats(&self) -> String {
AllocStats::report(self)
AllocStats::report()
}
/// Get configured trigger suggest command.
@ -781,7 +783,7 @@ impl SharedContext {
return cached;
}
let res = crate::analysis::term_value(val);
let res = term_value(val);
self.analysis
.caches