Skip to content

Commit 5028753

Browse files
committed
Fixes
1 parent 4c170a7 commit 5028753

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/actions/GenerateSnippet.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import {
88
import { ensureSingleTarget } from "../util/targetUtils";
99
import { range, repeat, zip } from "lodash";
1010
import displayPendingEditDecorations from "../util/editDisplayUtils";
11-
import { performEditsAndUpdateSelections } from "../util/updateSelections";
1211
import { performDocumentEdits } from "../util/performDocumentEdits";
1312
import { commands, SnippetString, window, workspace } from "vscode";
1413
import { join } from "path";
1514
import { open } from "fs/promises";
15+
import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections";
1616

1717
export default class GenerateSnippet implements Action {
1818
getTargetPreferences: () => ActionPreferences[] = () => [
@@ -65,6 +65,7 @@ export default class GenerateSnippet implements Action {
6565

6666
const [placeholderRanges, [targetSelection]] =
6767
await performEditsAndUpdateSelections(
68+
this.graph.rangeUpdater,
6869
editor,
6970
originalSelections.map((selection, index) => ({
7071
editor,
@@ -117,6 +118,7 @@ export default class GenerateSnippet implements Action {
117118
});
118119

119120
await performDocumentEdits(
121+
this.graph.rangeUpdater,
120122
editor,
121123
zip(placeholderRanges, originalSelectionTexts).map(([range, text]) => ({
122124
editor,

src/actions/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import ExecuteCommand from "./ExecuteCommand";
3434
import FollowLink from "./FollowLink";
3535
import Highlight from "./Highlight";
3636
import InsertSnippet from "./InsertSnippet";
37+
import GenerateSnippet from "./GenerateSnippet";
3738

3839
class Actions implements ActionRecord {
3940
constructor(private graph: Graph) {}
@@ -58,6 +59,7 @@ class Actions implements ActionRecord {
5859
insertEmptyLineBefore = new InsertEmptyLineAbove(this.graph);
5960
insertEmptyLinesAround = new InsertEmptyLinesAround(this.graph);
6061
insertSnippet = new InsertSnippet(this.graph);
62+
generateSnippet = new GenerateSnippet(this.graph);
6163
moveToTarget = new Move(this.graph);
6264
outdentLine = new OutdentLines(this.graph);
6365
pasteFromClipboard = new Paste(this.graph);

src/typings/Types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ export type ActionType =
393393
| "findInWorkspace"
394394
| "foldRegion"
395395
| "followLink"
396+
| "generateSnippet"
396397
| "getText"
397398
| "highlight"
398399
| "indentLine"

0 commit comments

Comments
 (0)