MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / mapRanges

Function mapRanges

src/cm/colorView.ts:189–199  ·  view source on GitHub ↗
(
	ranges: readonly DocRange[],
	changes: ViewUpdate["changes"],
)

Source from the content-addressed store, hash-verified

187}
188
189function mapRanges(
190 ranges: readonly DocRange[],
191 changes: ViewUpdate["changes"],
192): DocRange[] {
193 return normalizeRanges(
194 ranges.map(({ from, to }) => ({
195 from: changes.mapPos(from, -1),
196 to: changes.mapPos(to, 1),
197 })),
198 );
199}
200
201function expandRangeToLines(doc: Text, from: number, to: number): DocRange {
202 if (doc.length === 0) return { from: 0, to: 0 };

Callers 1

scheduleDecorationsMethod · 0.85

Calls 1

normalizeRangesFunction · 0.85

Tested by

no test coverage detected