MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / getRanges

Method getRanges

src/actions/CopyLines.ts:25–40  ·  view source on GitHub ↗
(editor: TextEditor, targets: TypedSelection[])

Source from the content-addressed store, hash-verified

23 }
24
25 private getRanges(editor: TextEditor, targets: TypedSelection[]) {
26 const paragraphTargets = targets.filter(
27 (target) => target.selectionType === "paragraph"
28 );
29 const ranges = targets.map((target) =>
30 expandToContainingLine(editor, target.selection.selection)
31 );
32 const unifiedRanges = unifyRanges(ranges);
33 return unifiedRanges.map((range) => ({
34 range,
35 isParagraph:
36 paragraphTargets.find((target) =>
37 target.selection.selection.isEqual(range)
38 ) != null,
39 }));
40 }
41
42 private getEdits(
43 editor: TextEditor,

Callers 1

runMethod · 0.95

Calls 2

expandToContainingLineFunction · 0.85
unifyRangesFunction · 0.85

Tested by

no test coverage detected