fix: errors in other modules are ignored

This commit is contained in:
Shunsuke Shibayama 2023-06-22 16:32:10 +09:00
parent 7ba874a85c
commit eaeb659a7d
13 changed files with 214 additions and 75 deletions

View file

@ -314,6 +314,7 @@ pub struct Server<Checker: BuildRunnable = HIRBuilder, Parser: Parsable = Simple
pub(crate) opt_features: Vec<OptionalFeatures>,
pub(crate) file_cache: FileCache,
pub(crate) comp_cache: CompletionCache,
// TODO: remove modules, analysis_result, and add `shared: SharedCompilerResource`
pub(crate) modules: ModuleCache,
pub(crate) analysis_result: AnalysisResultCache,
pub(crate) current_sig: Option<Expr>,
@ -723,8 +724,7 @@ impl<Checker: BuildRunnable, Parser: Parsable> Server<Checker, Parser> {
pub(crate) fn get_checker(&self, path: PathBuf) -> Checker {
if let Some(shared) = self.get_shared() {
let shared = shared.clone();
shared.mod_cache.remove(&path);
shared.py_mod_cache.remove(&path);
shared.clear(&path);
Checker::inherit(self.cfg.inherit(path), shared)
} else {
Checker::new(self.cfg.inherit(path))