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

Function collect_from_construct

src/folding.rs:737–784  ·  view source on GitHub ↗
(
    construct: &construct::Construct<'_>,
    content: &str,
    ranges: &mut Vec<FoldingRange>,
)

Source from the content-addressed store, hash-verified

735}
736
737fn collect_from_construct(
738 construct: &construct::Construct<'_>,
739 content: &str,
740 ranges: &mut Vec<FoldingRange>,
741) {
742 match construct {
743 construct::Construct::Print(print) => {
744 collect_from_expression(print.value, content, ranges);
745 }
746 construct::Construct::Exit(exit) => {
747 if let Some(ref args) = exit.arguments {
748 for arg in args.arguments.iter() {
749 collect_from_expression(arg.value(), content, ranges);
750 }
751 }
752 }
753 construct::Construct::Die(die) => {
754 if let Some(ref args) = die.arguments {
755 for arg in args.arguments.iter() {
756 collect_from_expression(arg.value(), content, ranges);
757 }
758 }
759 }
760 construct::Construct::Isset(isset) => {
761 for val in isset.values.iter() {
762 collect_from_expression(val, content, ranges);
763 }
764 }
765 construct::Construct::Empty(empty) => {
766 collect_from_expression(empty.value, content, ranges);
767 }
768 construct::Construct::Eval(eval) => {
769 collect_from_expression(eval.value, content, ranges);
770 }
771 construct::Construct::Include(include) => {
772 collect_from_expression(include.value, content, ranges);
773 }
774 construct::Construct::IncludeOnce(include) => {
775 collect_from_expression(include.value, content, ranges);
776 }
777 construct::Construct::Require(require) => {
778 collect_from_expression(require.value, content, ranges);
779 }
780 construct::Construct::RequireOnce(require) => {
781 collect_from_expression(require.value, content, ranges);
782 }
783 }
784}
785
786// ─── Comment folding ────────────────────────────────────────────────────────
787

Callers 1

collect_from_expressionFunction · 0.85

Calls 2

iterMethod · 0.80
collect_from_expressionFunction · 0.70

Tested by

no test coverage detected