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

Function collect_from_property_hooks

src/folding.rs:426–446  ·  view source on GitHub ↗

Collect folding ranges from property hooks if present.

(
    prop: &class_like::property::Property<'_>,
    content: &str,
    ranges: &mut Vec<FoldingRange>,
)

Source from the content-addressed store, hash-verified

424
425/// Collect folding ranges from property hooks if present.
426fn collect_from_property_hooks(
427 prop: &class_like::property::Property<'_>,
428 content: &str,
429 ranges: &mut Vec<FoldingRange>,
430) {
431 let hook_list = match prop {
432 class_like::property::Property::Hooked(h) => &h.hook_list,
433 class_like::property::Property::Plain(_) => return,
434 };
435 emit_brace_pair(hook_list.left_brace, hook_list.right_brace, content, ranges);
436 for hook in hook_list.hooks.iter() {
437 if let class_like::property::PropertyHookBody::Concrete(concrete) = &hook.body
438 && let class_like::property::PropertyHookConcreteBody::Block(block) = concrete
439 {
440 emit_block(block, content, ranges);
441 for inner in block.statements.iter() {
442 collect_from_statement(inner, content, ranges);
443 }
444 }
445 }
446}
447
448// ─── Expression walker ──────────────────────────────────────────────────────
449

Callers 1

Calls 4

emit_brace_pairFunction · 0.85
emit_blockFunction · 0.85
iterMethod · 0.80
collect_from_statementFunction · 0.70

Tested by

no test coverage detected