MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / active_resolved_class_cache

Function active_resolved_class_cache

src/virtual_members/mod.rs:155–165  ·  view source on GitHub ↗

Return the currently-active [`ResolvedClassCache`], if any. Returns `None` when no [`with_active_resolved_class_cache`] guard is alive on this thread. # Safety The returned reference borrows the cache through a raw pointer set by [`with_active_resolved_class_cache`]. This is safe because the pointer is only non-null while the [`ResolvedCacheGuard`] (which holds a borrow of the original `&Resol

()

Source from the content-addressed store, hash-verified

153/// pointer is only non-null while the [`ResolvedCacheGuard`] (which
154/// holds a borrow of the original `&ResolvedClassCache`) is alive.
155pub fn active_resolved_class_cache() -> Option<&'static ResolvedClassCache> {
156 let ptr = ACTIVE_RESOLVED_CACHE.with(|c| c.get());
157 if ptr.is_null() {
158 None
159 } else {
160 // SAFETY: ptr was set from a valid &ResolvedClassCache reference
161 // and the ResolvedCacheGuard that owns the borrow is still alive
162 // (it clears the pointer on drop).
163 Some(unsafe { &*ptr })
164 }
165}
166
167/// Evict all cache entries whose FQN matches the given name, then
168/// transitively evict any cached class that depends on the evicted

Callers 7

apply_property_narrowingFunction · 0.85
resolve_named_typeFunction · 0.85
resolve_variable_typesFunction · 0.85

Calls 2

is_nullMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected