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

Function emit_paren_pair

src/folding.rs:99–117  ·  view source on GitHub ↗

Emit a folding range for a parenthesised list (argument list, parameter list) only when it spans multiple lines.

(
    left: mago_span::Span,
    right: mago_span::Span,
    content: &str,
    ranges: &mut Vec<FoldingRange>,
)

Source from the content-addressed store, hash-verified

97/// Emit a folding range for a parenthesised list (argument list, parameter
98/// list) only when it spans multiple lines.
99fn emit_paren_pair(
100 left: mago_span::Span,
101 right: mago_span::Span,
102 content: &str,
103 ranges: &mut Vec<FoldingRange>,
104) {
105 let start_pos = offset_to_position(content, left.start.offset as usize);
106 let end_pos = offset_to_position(content, right.end.offset as usize);
107 if start_pos.line < end_pos.line {
108 ranges.push(FoldingRange {
109 start_line: start_pos.line,
110 start_character: Some(start_pos.character),
111 end_line: end_pos.line,
112 end_character: Some(end_pos.character),
113 kind: None,
114 collapsed_text: None,
115 });
116 }
117}
118
119// ─── Statement walker ───────────────────────────────────────────────────────
120

Callers 4

collect_from_statementFunction · 0.85
collect_from_expressionFunction · 0.85
collect_from_callFunction · 0.85

Calls 2

offset_to_positionFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected