Collect folding ranges from property hooks if present.
(
prop: &class_like::property::Property<'_>,
content: &str,
ranges: &mut Vec<FoldingRange>,
)
| 424 | |
| 425 | /// Collect folding ranges from property hooks if present. |
| 426 | fn 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 |
no test coverage detected