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

Method run

src/actions/CutCopyPaste.ts:23–54  ·  view source on GitHub ↗
([targets]: [TypedSelection[]])

Source from the content-addressed store, hash-verified

21 }
22
23 async run([targets]: [TypedSelection[]]): Promise<ActionReturnValue> {
24 const insideTargets = targets.map((target) =>
25 performInsideOutsideAdjustment(target, "inside")
26 );
27 const outsideTargets = targets.map((target) =>
28 performInsideOutsideAdjustment(target, "outside")
29 );
30 const outsideTargetDecorations = zip(insideTargets, outsideTargets).flatMap(
31 ([inside, outside]) => getOutsideOverflow(inside!, outside!)
32 );
33 const options = { showDecorations: false };
34
35 await Promise.all([
36 displayPendingEditDecorations(
37 insideTargets,
38 this.graph.editStyles.referenced
39 ),
40 displayPendingEditDecorations(
41 outsideTargetDecorations,
42 this.graph.editStyles.pendingDelete
43 ),
44 ]);
45
46 await this.graph.actions.copyToClipboard.run([insideTargets], options);
47
48 const { thatMark } = await this.graph.actions.remove.run(
49 [outsideTargets],
50 options
51 );
52
53 return { thatMark };
54 }
55}
56
57export class Copy extends CommandAction {

Callers

nothing calls this directly

Calls 4

getOutsideOverflowFunction · 0.90
runMethod · 0.65

Tested by

no test coverage detected