-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move node dependencies out of commons and engine (#2500)
This is all about getting node out of commons. A lot of our file system interaction had to do with running tests and reading/writing test fixtures so I created a separate node test package. To avoid circular dependencies I had to move a bunch of types from the engine to commons. This make it so we now have changes in imports in a bunch of different files. Most of the changes are quite mechanical or boilerplate. The only actual new code is the two storage providers to `ScopeTestRecorder` and `TestCaseRecorder`. The latter one is quite lacking in implementation. This is just about unblocking cursorless everywhere. A better abstraction is something we can workshop together. And before you ask: no I can't split this into smaller pr. It feels like a small miracle that I could solve all of the circular dependency problems I had already :) I wonder if we in a follow up want to move everything test related to the test package? Generally I prefer to have test as close to the source code as possible but in this case it's getting problematic to keeping track of all the dependencies. If we had a test package we could make sure that a lot of the dependencies only existed in that package and we could add lint rules preventing them in the other packages. ## 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 --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
- Loading branch information
1 parent
b708cc4
commit b9590b4
Showing
99 changed files
with
449 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
5 changes: 1 addition & 4 deletions
5
...ne/src/scopeProviders/TalonSpokenForms.ts → ...ages/common/src/types/TalonSpokenForms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { FakeCommandServerApi } from "../FakeCommandServerApi"; | ||
import type { IDE } from "../ide/types/ide.types"; | ||
import type { | ||
ExcludableSnapshotField, | ||
ExtraSnapshotField, | ||
TestCaseSnapshot, | ||
} from "../testUtil/TestCaseSnapshot"; | ||
import type { SerializedMarks, TargetPlainObject } from "../util/toPlainObject"; | ||
import type { HatTokenMap } from "./HatTokenMap"; | ||
import type { TextEditor } from "./TextEditor"; | ||
|
||
export interface TestHelpers { | ||
hatTokenMap: HatTokenMap; | ||
|
||
// FIXME: Remove this once we have a better way to get this function | ||
// accessible from our tests | ||
takeSnapshot( | ||
excludeFields: ExcludableSnapshotField[], | ||
extraFields: ExtraSnapshotField[], | ||
editor: TextEditor, | ||
ide: IDE, | ||
marks: SerializedMarks | undefined, | ||
): Promise<TestCaseSnapshot>; | ||
|
||
setStoredTarget( | ||
editor: TextEditor, | ||
key: string, | ||
targets: TargetPlainObject[] | undefined, | ||
): void; | ||
|
||
commandServerApi: FakeCommandServerApi; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
"references": [ | ||
{ | ||
"path": "../common" | ||
}, | ||
{ | ||
"path": "../node-common" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
packages/cursorless-engine/src/actions/GenerateSnippet/GenerateSnippet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
packages/cursorless-engine/src/disabledComponents/DisabledTalonSpokenForms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
packages/cursorless-engine/src/disabledComponents/DisabledTreeSitter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.