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

Function is_in_nested_frame

src/diagnostics/unused_variables.rs:469–477  ·  view source on GitHub ↗

Check whether `offset` falls inside any nested frame (closure, arrow function, or catch) within the given parent frame.

(
    offset: u32,
    parent: &crate::scope_collector::Frame,
    frames: &[crate::scope_collector::Frame],
)

Source from the content-addressed store, hash-verified

467/// Check whether `offset` falls inside any nested frame (closure,
468/// arrow function, or catch) within the given parent frame.
469fn is_in_nested_frame(
470 offset: u32,
471 parent: &crate::scope_collector::Frame,
472 frames: &[crate::scope_collector::Frame],
473) -> bool {
474 frames.iter().any(|f| {
475 f.start > parent.start && f.end < parent.end && offset >= f.start && offset <= f.end
476 })
477}
478
479/// Check whether a write access at `offset` for variable `name` is
480/// actually a parameter declaration of a nested closure or arrow

Callers 1

check_scopeFunction · 0.70

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected