mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
fix(els): caching bugs
This commit is contained in:
parent
f2ad45878a
commit
82792aca80
8 changed files with 68 additions and 6 deletions
|
@ -102,6 +102,21 @@ impl SharedPromises {
|
|||
.insert(path, Promise::running(handle));
|
||||
}
|
||||
|
||||
pub fn remove(&self, path: &Path) {
|
||||
self.promises.borrow_mut().remove(path);
|
||||
}
|
||||
|
||||
pub fn initialize(&self) {
|
||||
self.promises.borrow_mut().clear();
|
||||
}
|
||||
|
||||
pub fn rename(&self, old: &Path, new: PathBuf) {
|
||||
let Some(promise) = self.promises.borrow_mut().remove(old) else {
|
||||
return;
|
||||
};
|
||||
self.promises.borrow_mut().insert(new.into(), promise);
|
||||
}
|
||||
|
||||
pub fn is_registered(&self, path: &Path) -> bool {
|
||||
self.promises.borrow().get(path).is_some()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue