mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
feat(els): workspace diagnostics
This commit is contained in:
parent
f4928e3a51
commit
64874f4169
5 changed files with 197 additions and 16 deletions
|
@ -153,6 +153,10 @@ impl ModuleCache {
|
|||
self.cache.iter()
|
||||
}
|
||||
|
||||
pub fn values(&self) -> impl Iterator<Item = &ModuleEntry> {
|
||||
self.cache.values()
|
||||
}
|
||||
|
||||
pub fn clear(&mut self) {
|
||||
self.cache.clear();
|
||||
}
|
||||
|
@ -284,4 +288,16 @@ impl SharedModuleCache {
|
|||
pub fn ref_inner(&self) -> MappedRwLockReadGuard<Dict<NormalizedPathBuf, ModuleEntry>> {
|
||||
RwLockReadGuard::map(self.0.borrow(), |mc| &mc.cache)
|
||||
}
|
||||
|
||||
pub fn raw_values(&self) -> impl Iterator<Item = &ModuleEntry> {
|
||||
let _ref = self.0.borrow();
|
||||
let ref_ = unsafe { self.0.as_ptr().as_ref().unwrap() };
|
||||
ref_.values()
|
||||
}
|
||||
|
||||
pub fn raw_iter(&self) -> impl Iterator<Item = (&NormalizedPathBuf, &ModuleEntry)> {
|
||||
let _ref = self.0.borrow();
|
||||
let ref_ = unsafe { self.0.as_ptr().as_ref().unwrap() };
|
||||
ref_.iter()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue