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

Function enclosing_frame_finds_function

src/scope_collector/tests.rs:619–631  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

617
618#[test]
619fn enclosing_frame_finds_function() {
620 let php = r#"<?php
621function test() {
622 $x = 1;
623}
624"#;
625 let scope_map = collect_from_function(php);
626
627 // Any offset inside the function body should find the function frame.
628 let frame = scope_map.enclosing_frame(scope_map.frames[0].start + 1);
629 assert!(frame.is_some());
630 assert_eq!(frame.unwrap().kind, FrameKind::Function);
631}
632
633#[test]
634fn variables_in_scope_lists_all() {

Callers

nothing calls this directly

Calls 2

collect_from_functionFunction · 0.85
enclosing_frameMethod · 0.80

Tested by

no test coverage detected