-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Hat snapshots #318
Hat snapshots #318
Conversation
@@ -432,15 +432,15 @@ | |||
"watch": "tsc -watch -p ./", | |||
"pretest": "yarn run compile && yarn run lint && yarn run esbuild", | |||
"lint": "eslint src --ext ts", | |||
"test": "node ./out/test/runTest.js" | |||
"test": "env CURSORLESS_TEST=true node ./out/test/runTest.js" |
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.
For consistency with local unit testing, where this variable is set by launch.json
|
||
this.recomputeDecorationStyles = this.recomputeDecorationStyles.bind(this); | ||
|
||
this.disposables.push( |
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.
Note how graph components do their own registration now
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.
Looks good really clean things up
thatMark, | ||
sourceMark, | ||
addDecorations, | ||
graph: isTesting() ? graph : undefined, |
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.
We now return the entire graph
object, but only if we're in testing mode
@@ -0,0 +1,49 @@ | |||
import { ActionType, PartialTarget } from "../../typings/Types"; |
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.
Here's the new command argument type definitions
spokenFormOrCommandArgument: string | CommandArgument, | ||
...rest: unknown[] |
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.
Here's the ugliness that allows us to handle either old or new command arguments
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 think that works fine
@@ -1,8 +1,9 @@ | |||
spokenForm: bring air and bat and cap |
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.
New recorded test syntax just stores an exact snapshot of the command argument that comes in to the cursorless command
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.
Sounds good. Really inline with our discussion about that the tests should only capture what the user actually said.
inputPartialTargets: PartialTarget[], | ||
inputExtraArgs: any[] | ||
) { | ||
commandArgument: CommandArgument |
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.
Now that we have one argument packaged together, we can just input a command argument and return a new command argument that is latest version
partialTargets: PartialTarget[]; | ||
extraArgs: any[]; | ||
}; | ||
export type TestCaseCommand = CommandArgument; |
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.
Notice how this one is just a regular command argument now
I must admit I haven't looked through all the code. But I think the changes to the api and command version looks good. |
Description
Allows voice engine to emit a signal to indicate start of phrase, which causes the hat token map to be frozen during the course of all commands issued during the given phrase. The ranges will be updated as the document changes, but the same hat names will refer to the same logical document token during the course of the phrase. This feature allows users to issue longer voice commands without worrying about the hats shifting during the course of phrase execution
Related issues
Todo
signals
toinboundSignals
getNamedSignal
from command-server API (here and in extension)