Skip to content

Commit a2e4a61

Browse files
Moved takeSnapshot into test-case-recorder package (#2514)
## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet
1 parent edfdec7 commit a2e4a61

File tree

8 files changed

+8
-9
lines changed

8 files changed

+8
-9
lines changed

packages/common/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export { HatStability } from "./ide/types/HatStability";
99
export * from "./util";
1010
export * from "./ide/util/messages";
1111
export { getKey, splitKey } from "./util/splitKey";
12-
export { hrtimeBigintToSeconds } from "./util/timeUtils";
1312
export * from "./util/disposableFrom";
1413
export * from "./util/camelCaseToAllDown";
1514
export { Notifier } from "./util/Notifier";

packages/cursorless-engine/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from "./testUtil/plainObjectToTarget";
2-
export * from "./testUtil/takeSnapshot";
32
export * from "./core/StoredTargets";
43
export * from "./cursorlessEngine";
54
export * from "./generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters";

packages/cursorless-vscode/src/constructTestHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import {
1515
import {
1616
StoredTargetMap,
1717
plainObjectToTarget,
18-
takeSnapshot,
1918
} from "@cursorless/cursorless-engine";
2019
import { VscodeTestHelpers } from "@cursorless/vscode-common";
2120
import * as vscode from "vscode";
21+
import { takeSnapshot } from "@cursorless/test-case-recorder";
2222
import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem";
2323
import { VscodeIDE } from "./ide/vscode/VscodeIDE";
2424
import { toVscodeEditor } from "./ide/vscode/toVscodeEditor";

packages/test-case-recorder/src/TestCase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import {
2424
import {
2525
extractTargetKeys,
2626
getPartialTargetDescriptors,
27-
takeSnapshot,
2827
type StoredTargetMap,
2928
} from "@cursorless/cursorless-engine";
3029
import { pick } from "lodash-es";
30+
import { takeSnapshot } from "./takeSnapshot";
3131

3232
export class TestCase {
3333
private languageId: string;

packages/test-case-recorder/src/TestCaseRecorder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
injectIde,
2929
SpokenFormGenerator,
3030
StoredTargetMap,
31-
takeSnapshot,
3231
} from "@cursorless/cursorless-engine";
3332
import { getRecordedTestsDirPath, walkDirsSync } from "@cursorless/node-common";
3433
import { invariant } from "immutability-helper";
@@ -37,6 +36,7 @@ import * as fs from "node:fs";
3736
import { access, readFile } from "node:fs/promises";
3837
import * as path from "node:path";
3938
import { RecordTestCaseCommandOptions } from "./RecordTestCaseCommandOptions";
39+
import { takeSnapshot } from "./takeSnapshot";
4040
import { TestCase } from "./TestCase";
4141

4242
const CALIBRATION_DISPLAY_DURATION_MS = 50;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
export * from "./TestCaseRecorder";
21
export * from "./ScopeTestRecorder";
2+
export * from "./takeSnapshot";
3+
export * from "./TestCaseRecorder";

packages/cursorless-engine/src/testUtil/takeSnapshot.ts renamed to packages/test-case-recorder/src/takeSnapshot.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import {
22
ExcludableSnapshotField,
33
ExtraContext,
44
ExtraSnapshotField,
5-
hrtimeBigintToSeconds,
65
IDE,
76
rangeToPlainObject,
87
selectionToPlainObject,
98
SerializedMarks,
9+
storedTargetKeys,
1010
TestCaseSnapshot,
1111
TextEditor,
1212
} from "@cursorless/common";
13-
import { type StoredTargetMap } from "../core/StoredTargets";
14-
import { storedTargetKeys } from "@cursorless/common";
13+
import type { StoredTargetMap } from "@cursorless/cursorless-engine";
14+
import { hrtimeBigintToSeconds } from "./timeUtils";
1515

1616
export async function takeSnapshot(
1717
storedTargets: StoredTargetMap | undefined,

0 commit comments

Comments
 (0)