-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No automatic token expansion for "from"; stored target cleanup (#2170)
## Checklist - [x] 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
- Loading branch information
Showing
10 changed files
with
144 additions
and
57 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
9 changes: 6 additions & 3 deletions
9
...ngine/src/actions/SetInstanceReference.ts → ...ss-engine/src/actions/SetSpecialTarget.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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import { StoredTargetKey } from "@cursorless/common"; | ||
import { Target } from "../typings/target.types"; | ||
import { SimpleAction, ActionReturnValue } from "./actions.types"; | ||
|
||
export class SetInstanceReference implements SimpleAction { | ||
constructor() { | ||
export class SetSpecialTarget implements SimpleAction { | ||
noAutomaticTokenExpansion = true; | ||
|
||
constructor(private key: StoredTargetKey) { | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
async run(targets: Target[]): Promise<ActionReturnValue> { | ||
return { | ||
thatTargets: targets, | ||
instanceReferenceTargets: targets, | ||
[`${this.key}Targets`]: targets, | ||
}; | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
...ages/cursorless-vscode-e2e/src/suite/fixtures/recorded/actions/changeNextInstanceChar.yml
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,42 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: change next instance char | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: relativeScope | ||
scopeType: {type: instance} | ||
offset: 1 | ||
length: 1 | ||
direction: forward | ||
- type: containingScope | ||
scopeType: {type: character} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: aba aaa | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
instanceReferenceMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 0, character: 0} | ||
end: {line: 0, character: 0} | ||
isReversed: false | ||
hasExplicitRange: false | ||
finalState: | ||
documentContents: ba aaa | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
thatMark: | ||
- type: RawSelectionTarget | ||
contentRange: | ||
start: {line: 0, character: 0} | ||
end: {line: 0, character: 0} | ||
isReversed: false | ||
hasExplicitRange: true |
35 changes: 35 additions & 0 deletions
35
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/actions/fromThis.yml
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,35 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: from this | ||
action: | ||
name: experimental.setInstanceReference | ||
target: | ||
type: primitive | ||
mark: {type: cursor} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: aba aaa | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: aba aaa | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
thatMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 0, character: 0} | ||
end: {line: 0, character: 0} | ||
isReversed: false | ||
hasExplicitRange: false | ||
instanceReferenceMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 0, character: 0} | ||
end: {line: 0, character: 0} | ||
isReversed: false | ||
hasExplicitRange: false |
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