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

Function collect_from_if

src/folding.rs:354–384  ·  view source on GitHub ↗
(if_stmt: &If<'_>, content: &str, ranges: &mut Vec<FoldingRange>)

Source from the content-addressed store, hash-verified

352// ─── If statement ───────────────────────────────────────────────────────────
353
354fn collect_from_if(if_stmt: &If<'_>, content: &str, ranges: &mut Vec<FoldingRange>) {
355 collect_from_expression(if_stmt.condition, content, ranges);
356 match &if_stmt.body {
357 IfBody::Statement(body) => {
358 collect_from_block_statement(body.statement, content, ranges);
359 for else_if in body.else_if_clauses.iter() {
360 collect_from_expression(else_if.condition, content, ranges);
361 collect_from_block_statement(else_if.statement, content, ranges);
362 }
363 if let Some(ref else_clause) = body.else_clause {
364 collect_from_block_statement(else_clause.statement, content, ranges);
365 }
366 }
367 IfBody::ColonDelimited(body) => {
368 for inner in body.statements.iter() {
369 collect_from_statement(inner, content, ranges);
370 }
371 for else_if in body.else_if_clauses.iter() {
372 collect_from_expression(else_if.condition, content, ranges);
373 for inner in else_if.statements.iter() {
374 collect_from_statement(inner, content, ranges);
375 }
376 }
377 if let Some(ref else_clause) = body.else_clause {
378 for inner in else_clause.statements.iter() {
379 collect_from_statement(inner, content, ranges);
380 }
381 }
382 }
383 }
384}
385
386// ─── Class member walker ────────────────────────────────────────────────────
387

Callers 1

collect_from_statementFunction · 0.85

Calls 4

iterMethod · 0.80
collect_from_expressionFunction · 0.70
collect_from_statementFunction · 0.70

Tested by

no test coverage detected