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

Method enclosing_frame

src/scope_collector/mod.rs:212–219  ·  view source on GitHub ↗

Find the innermost frame that fully contains the given offset.

(&self, offset: u32)

Source from the content-addressed store, hash-verified

210impl ScopeMap {
211 /// Find the innermost frame that fully contains the given offset.
212 pub(crate) fn enclosing_frame(&self, offset: u32) -> Option<&Frame> {
213 // Iterate in reverse so we find the innermost (most recently
214 // opened) frame first. Frames are sorted by start offset.
215 self.frames
216 .iter()
217 .rev()
218 .find(|f| offset >= f.start && offset <= f.end)
219 }
220
221 /// Find the innermost frame that fully contains the given range.
222 pub(crate) fn enclosing_frame_for_range(&self, start: u32, end: u32) -> Option<&Frame> {

Callers 4

variables_in_scopeMethod · 0.80
all_occurrencesMethod · 0.80

Calls 2

iterMethod · 0.80
findMethod · 0.45

Tested by 1