-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathFind.ts
More file actions
32 lines (26 loc) · 769 Bytes
/
Find.ts
File metadata and controls
32 lines (26 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import {
Action,
ActionReturnValue,
ActionPreferences,
Graph,
TypedSelection,
} from "../typings/Types";
import { commands } from "vscode";
import { ensureSingleTarget } from "../util/targetUtils";
export class FindInFiles implements Action {
getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }];
constructor(private graph: Graph) {
this.run = this.run.bind(this);
}
async run([targets]: [TypedSelection[]]): Promise<ActionReturnValue> {
ensureSingleTarget(targets);
const {
returnValue: [query],
thatMark,
} = await this.graph.actions.getText.run([targets]);
await commands.executeCommand("workbench.action.findInFiles", {
query,
});
return { thatMark };
}
}