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

Method run

src/actions/GetText.ts:18–43  ·  view source on GitHub ↗
(
    [targets]: [TypedSelection[]],
    {
      showDecorations = true,
      ensureSingleTarget: doEnsureSingleTarget = false,
    } = {}
  )

Source from the content-addressed store, hash-verified

16 }
17
18 async run(
19 [targets]: [TypedSelection[]],
20 {
21 showDecorations = true,
22 ensureSingleTarget: doEnsureSingleTarget = false,
23 } = {}
24 ): Promise<ActionReturnValue> {
25 if (showDecorations) {
26 await displayPendingEditDecorations(
27 targets,
28 this.graph.editStyles.referenced
29 );
30 }
31 if (doEnsureSingleTarget) {
32 ensureSingleTarget(targets);
33 }
34
35 const returnValue = targets.map((target) =>
36 target.selection.editor.document.getText(target.selection.selection)
37 );
38
39 return {
40 returnValue,
41 thatMark: targets.map((target) => target.selection),
42 };
43 }
44}

Callers

nothing calls this directly

Calls 2

ensureSingleTargetFunction · 0.90

Tested by

no test coverage detected