-
-
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.
Not all the behavior is perfect (I'm looking at you, pour and drink), but it's better than not existing. The perfect is the enemy of the good. ## 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 --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Pokey Rule <[email protected]>
- Loading branch information
1 parent
e5d1dfc
commit 6660914
Showing
29 changed files
with
935 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package p | ||
|
||
func switches(x any) { | ||
switch x { | ||
case 1: | ||
// bar | ||
case 2: | ||
x = nil | ||
case "s": | ||
case 4, "t": | ||
x = 7 | ||
// qux | ||
case 5: | ||
// foo | ||
fallthrough | ||
default: | ||
panic("x") | ||
} | ||
switch x := x.(type) { | ||
case int: | ||
x++ | ||
case string, struct{}: | ||
println(x) | ||
default: | ||
panic(x) | ||
} | ||
switch { | ||
case x == 1: | ||
panic("one") | ||
case false: | ||
// unreachable | ||
} | ||
} | ||
|
||
func ifElseChains(x int) { | ||
if y := 0; x == 1 { | ||
// foo | ||
} else if z:=0; x == 2 { | ||
x-- | ||
x-- | ||
x-- | ||
} else if z:=0; x == 2 { | ||
x-- | ||
x-- | ||
x-- | ||
} else if x == 3 { | ||
x++ | ||
} else if x == 3 { | ||
x++ | ||
} else { | ||
x *= 2 | ||
} | ||
|
||
if x == 4{ | ||
x++ | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranch.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,23 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "if x {\n\tx++\n} else {\n\tx--\n}" | ||
selections: | ||
- anchor: {line: 4, character: 1} | ||
active: {line: 4, character: 1} | ||
marks: {} | ||
finalState: | ||
documentContents: "if x {\n\tx++\n} " | ||
selections: | ||
- anchor: {line: 2, character: 2} | ||
active: {line: 2, character: 2} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranch2.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,23 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "if x {\n\tx++\n} else {\n\tx--\n}" | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: " else {\n\tx--\n}" | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranch3.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,23 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "if x {\n\tx++\n} else if y {\n\ty++\n} else {\n\tx--\n}" | ||
selections: | ||
- anchor: {line: 2, character: 7} | ||
active: {line: 2, character: 7} | ||
marks: {} | ||
finalState: | ||
documentContents: "if x {\n\tx++\n} else {\n\tx--\n}" | ||
selections: | ||
- anchor: {line: 2, character: 2} | ||
active: {line: 2, character: 2} |
36 changes: 36 additions & 0 deletions
36
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranchAir.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,36 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch air | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
mark: {type: decoratedSymbol, symbolColor: default, character: a} | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
switch x { | ||
case 1: | ||
case 2: | ||
panic(x) | ||
} | ||
selections: | ||
- anchor: {line: 4, character: 1} | ||
active: {line: 4, character: 1} | ||
marks: | ||
default.a: | ||
start: {line: 2, character: 0} | ||
end: {line: 2, character: 4} | ||
finalState: | ||
documentContents: |- | ||
switch x { | ||
case 1: | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 0} | ||
active: {line: 2, character: 0} |
35 changes: 35 additions & 0 deletions
35
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranchCap.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: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch cap | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
mark: {type: decoratedSymbol, symbolColor: default, character: c} | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
switch x { | ||
case 1: | ||
case 2: | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 7} | ||
active: {line: 2, character: 7} | ||
marks: | ||
default.c: | ||
start: {line: 1, character: 0} | ||
end: {line: 1, character: 4} | ||
finalState: | ||
documentContents: |- | ||
switch x { | ||
case 2: | ||
} | ||
selections: | ||
- anchor: {line: 1, character: 0} | ||
active: {line: 1, character: 0} |
37 changes: 37 additions & 0 deletions
37
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranchCap2.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,37 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch cap | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
mark: {type: decoratedSymbol, symbolColor: default, character: c} | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
switch x := x.(type) { | ||
case int: | ||
default: | ||
panic(x) | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 8} | ||
marks: | ||
default.c: | ||
start: {line: 1, character: 0} | ||
end: {line: 1, character: 4} | ||
finalState: | ||
documentContents: |- | ||
switch x := x.(type) { | ||
default: | ||
panic(x) | ||
} | ||
selections: | ||
- anchor: {line: 1, character: 0} | ||
active: {line: 1, character: 0} |
36 changes: 36 additions & 0 deletions
36
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeBranchDrum.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,36 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change branch drum | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
mark: {type: decoratedSymbol, symbolColor: default, character: d} | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
switch x := x.(type) { | ||
case int: | ||
default: | ||
panic(x) | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 8} | ||
marks: | ||
default.d: | ||
start: {line: 2, character: 0} | ||
end: {line: 2, character: 7} | ||
finalState: | ||
documentContents: |- | ||
switch x := x.(type) { | ||
case int: | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 0} | ||
active: {line: 2, character: 0} |
27 changes: 27 additions & 0 deletions
27
...ages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/go/changeEveryBranch.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,27 @@ | ||
languageId: go | ||
command: | ||
version: 6 | ||
spokenForm: change every branch | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: branch} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "if x {\n\tx++\n} else if y {\n\ty++\n} else {\n\tx--\n}" | ||
selections: | ||
- anchor: {line: 0, character: 1} | ||
active: {line: 0, character: 1} | ||
marks: {} | ||
finalState: | ||
documentContents: " " | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
- anchor: {line: 0, character: 1} | ||
active: {line: 0, character: 1} | ||
- anchor: {line: 0, character: 2} | ||
active: {line: 0, character: 2} |
Oops, something went wrong.