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

Method run

src/actions/Delete.ts:22–55  ·  view source on GitHub ↗
(
    [targets]: [TypedSelection[]],
    { showDecorations = true } = {}
  )

Source from the content-addressed store, hash-verified

20 }
21
22 async run(
23 [targets]: [TypedSelection[]],
24 { showDecorations = true } = {}
25 ): Promise<ActionReturnValue> {
26 if (showDecorations) {
27 await displayPendingEditDecorations(
28 targets,
29 this.graph.editStyles.pendingDelete
30 );
31 }
32
33 const thatMark = flatten(
34 await runOnTargetsForEachEditor(targets, async (editor, targets) => {
35 const edits = targets.map((target) => ({
36 range: target.selection.selection,
37 text: "",
38 }));
39
40 const [updatedSelections] = await performEditsAndUpdateSelections(
41 this.graph.rangeUpdater,
42 editor,
43 edits,
44 [targets.map((target) => target.selection.selection)]
45 );
46
47 return updatedSelections.map((selection) => ({
48 editor,
49 selection,
50 }));
51 })
52 );
53
54 return { thatMark };
55 }
56}

Callers

nothing calls this directly

Tested by

no test coverage detected