fix: import type inference result from other modules (#2168)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled

fix #2131
This commit is contained in:
Myriad-Dreamin 2025-10-15 11:22:39 +08:00 committed by GitHub
parent d80199d744
commit 29a10c144e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 215 additions and 39 deletions

View file

@ -119,15 +119,11 @@ struct ScanDefCtx<'a> {
impl ScanDefCtx<'_> {
fn defs(&mut self, paths: EcoVec<&str>, ei: ExprInfo) -> DefInfo {
let name = {
let stem = ei.fid.vpath().as_rooted_path().file_stem();
stem.and_then(|s| Some(Interned::new_str(s.to_str()?)))
.unwrap_or_default()
};
let module_decl = Decl::module(name.clone(), ei.fid).into();
let module_decl = Decl::module(ei.fid);
let key = module_decl.name().clone();
let site = Some(self.root);
let paths = paths.clone();
self.def(&name, paths, site.as_ref(), &module_decl, None)
self.def(&key, paths, site.as_ref(), &module_decl.into(), None)
}
fn expr(