-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move node dependencies out of commons and engine #2500
Merged
Merged
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
62ce2d8
refactor
AndreasArvidsson 08de803
test case provider
AndreasArvidsson 824800f
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] c4181e9
rename
AndreasArvidsson 13cd65b
rename
AndreasArvidsson 71ce24c
fix import
AndreasArvidsson 035375d
Added dock string
AndreasArvidsson 65d54a2
Fix import
AndreasArvidsson 52da088
clean up
AndreasArvidsson 700ad47
fix import
AndreasArvidsson 2794e79
Added the wait
AndreasArvidsson d018fd1
Remove unused import
AndreasArvidsson 5aeea77
Remove imports
AndreasArvidsson 7acf1b1
refactor
AndreasArvidsson 19b24fc
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] ec6c48b
fix import
AndreasArvidsson bf96dca
Remove imports
AndreasArvidsson 54ce838
restore comment
AndreasArvidsson b51f3c3
Fix import#
AndreasArvidsson 80224b0
Fix import
AndreasArvidsson b72c485
restructure
AndreasArvidsson eb41192
move regex
AndreasArvidsson 23817e7
Merge branch 'main' into testRecorderProvider
AndreasArvidsson 1229e4b
Move scope test recorder into test package
AndreasArvidsson f21dc26
assert filename
AndreasArvidsson cd71783
Cleanup
AndreasArvidsson 15d0850
test for relative in engine
pokey 73a2f35
rename
pokey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { RecordTestCaseCommandOptions } from "../../testUtil/RecordTestCaseCommandOptions"; | ||
|
||
export interface RecordedTestStorage { | ||
getFixtureRoot(): string | null; | ||
saveTestCase(path: string, fixture: string): Promise<void>; | ||
removeTestCase(filePath: string): Promise<void>; | ||
hasAccess(path: string): Promise<boolean>; | ||
walkDir(dir: string): Promise<string[]>; | ||
calculateFilePath(dir: string, filename: string): Promise<string>; | ||
getCommandOptions(filePath: string): Promise<RecordTestCaseCommandOptions>; | ||
} |
AndreasArvidsson marked this conversation as resolved.
Show resolved
Hide resolved
|
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,8 @@ | ||
export interface ScopeTestRecorderStorage { | ||
getTestedScopeFacets(languageId: string): Set<string>; | ||
saveScopeFacetTest( | ||
languageId: string, | ||
facet: string, | ||
content: string, | ||
): Promise<void>; | ||
} |
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
52 changes: 52 additions & 0 deletions
52
packages/common/src/testUtil/RecordTestCaseCommandOptions.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { ExtraSnapshotField } from "@cursorless/common"; | ||
|
||
/** | ||
* This is the type of the `recordTestCase` command's argument. It is used to | ||
* specify the options for recording a test case. | ||
*/ | ||
export interface RecordTestCaseCommandOptions { | ||
/** | ||
* If this is set to `true`, then for each test case that we record, we expect | ||
* that the user will issue a second command in each phrase, which refers to a | ||
* decorated mark whose range we'd like to check that it got updated properly | ||
* during the previous command. We use this functionality in order to check | ||
* that the token range update works properly. For example, you might say | ||
* `"chuck second car ox air take air"` to check that removing a character | ||
* from a token properly updates the token. | ||
*/ | ||
isHatTokenMapTest?: boolean; | ||
|
||
/** If true decorations will be added to the test fixture */ | ||
isDecorationsTest?: boolean; | ||
|
||
/** | ||
* The directory in which to store the test cases that we record. If left out | ||
* the user will be prompted to select a directory within the default recorded | ||
* test case directory. | ||
*/ | ||
directory?: string; | ||
|
||
/** | ||
* If `true`, don't show a little pop up each time to indicate we've recorded a | ||
* test case | ||
*/ | ||
isSilent?: boolean; | ||
|
||
extraSnapshotFields?: ExtraSnapshotField[]; | ||
|
||
/** | ||
* Whether to flash a background for calibrating a video recording | ||
*/ | ||
showCalibrationDisplay?: boolean; | ||
|
||
/** | ||
* Whether we should record a tests which yield errors in addition to tests | ||
* which do not error. | ||
*/ | ||
recordErrors?: boolean; | ||
|
||
/** | ||
* Whether to capture the `that` mark returned by the action. | ||
*/ | ||
captureFinalThatMark?: boolean; | ||
} |
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
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
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/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
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
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
AndreasArvidsson marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation I'm not quite happy with. The problem is that normalized ide is used in the extension bundle and uses a environment fixture path. I will happily take any suggestions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean
NormalizedIDE
is really test / dev code, so probalby shouldn't be in engine / common. But I'm ok with this for now