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

Function to_selection_range

src/selection_range.rs:93–104  ·  view source on GitHub ↗
(
    content: &str,
    span: (u32, u32),
    parent: Option<SelectionRange>,
)

Source from the content-addressed store, hash-verified

91}
92
93fn to_selection_range(
94 content: &str,
95 span: (u32, u32),
96 parent: Option<SelectionRange>,
97) -> SelectionRange {
98 let start = offset_to_position(content, span.0 as usize);
99 let end = offset_to_position(content, span.1 as usize);
100 SelectionRange {
101 range: Range::new(start, end),
102 parent: parent.map(Box::new),
103 }
104}
105
106// ─── Helpers ────────────────────────────────────────────────────────────────
107

Callers 1

build_selection_rangeFunction · 0.85

Calls 2

offset_to_positionFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected