Skip to content

Commit bc9cf96

Browse files
Added yaml support (#2071)
## 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: Pokey Rule <755842+pokey@users.noreply.github.com>
1 parent a723b25 commit bc9cf96

37 files changed

Lines changed: 988 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
foo: bar
16+
baz: bongo
17+
selections:
18+
- anchor: {line: 0, character: 0}
19+
active: {line: 0, character: 0}
20+
marks: {}
21+
finalState:
22+
documentContents: |+
23+
24+
selections:
25+
- anchor: {line: 0, character: 0}
26+
active: {line: 0, character: 0}
27+
- anchor: {line: 1, character: 0}
28+
active: {line: 1, character: 0}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "foo: { bar: baz, bongo: 0}"
15+
selections:
16+
- anchor: {line: 0, character: 6}
17+
active: {line: 0, character: 6}
18+
marks: {}
19+
finalState:
20+
documentContents: "foo: { , }"
21+
selections:
22+
- anchor: {line: 0, character: 7}
23+
active: {line: 0, character: 7}
24+
- anchor: {line: 0, character: 9}
25+
active: {line: 0, character: 9}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
foo:
16+
- 0
17+
- 1
18+
selections:
19+
- anchor: {line: 1, character: 2}
20+
active: {line: 1, character: 2}
21+
marks: {}
22+
finalState:
23+
documentContents: |-
24+
foo:
25+
26+
27+
selections:
28+
- anchor: {line: 1, character: 2}
29+
active: {line: 1, character: 2}
30+
- anchor: {line: 2, character: 2}
31+
active: {line: 2, character: 2}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "bar: [0, 1]"
15+
selections:
16+
- anchor: {line: 0, character: 6}
17+
active: {line: 0, character: 6}
18+
marks: {}
19+
finalState:
20+
documentContents: "bar: [, ]"
21+
selections:
22+
- anchor: {line: 0, character: 6}
23+
active: {line: 0, character: 6}
24+
- anchor: {line: 0, character: 8}
25+
active: {line: 0, character: 8}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every key
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionKey}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
foo: bar
16+
baz: bongo
17+
selections:
18+
- anchor: {line: 0, character: 0}
19+
active: {line: 0, character: 0}
20+
marks: {}
21+
finalState:
22+
documentContents: |-
23+
: bar
24+
: bongo
25+
selections:
26+
- anchor: {line: 0, character: 0}
27+
active: {line: 0, character: 0}
28+
- anchor: {line: 1, character: 0}
29+
active: {line: 1, character: 0}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every key
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionKey}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "foo: { bar: baz, bongo: 0}"
15+
selections:
16+
- anchor: {line: 0, character: 6}
17+
active: {line: 0, character: 6}
18+
marks: {}
19+
finalState:
20+
documentContents: "foo: { : baz, : 0}"
21+
selections:
22+
- anchor: {line: 0, character: 7}
23+
active: {line: 0, character: 7}
24+
- anchor: {line: 0, character: 14}
25+
active: {line: 0, character: 14}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every value
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: value}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
foo: bar
16+
baz: bongo
17+
selections:
18+
- anchor: {line: 0, character: 0}
19+
active: {line: 0, character: 0}
20+
marks: {}
21+
finalState:
22+
documentContents: |-
23+
foo:
24+
baz:
25+
selections:
26+
- anchor: {line: 0, character: 5}
27+
active: {line: 0, character: 5}
28+
- anchor: {line: 1, character: 5}
29+
active: {line: 1, character: 5}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change every value
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: value}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "foo: { bar: baz, bongo: 0}"
15+
selections:
16+
- anchor: {line: 0, character: 6}
17+
active: {line: 0, character: 6}
18+
marks: {}
19+
finalState:
20+
documentContents: "foo: { bar: , bongo: }"
21+
selections:
22+
- anchor: {line: 0, character: 12}
23+
active: {line: 0, character: 12}
24+
- anchor: {line: 0, character: 21}
25+
active: {line: 0, character: 21}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "foo: bar"
15+
selections:
16+
- anchor: {line: 0, character: 0}
17+
active: {line: 0, character: 0}
18+
marks: {}
19+
finalState:
20+
documentContents: ""
21+
selections:
22+
- anchor: {line: 0, character: 0}
23+
active: {line: 0, character: 0}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
languageId: yaml
2+
command:
3+
version: 6
4+
spokenForm: change item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
foo:
16+
- 0
17+
- 1
18+
selections:
19+
- anchor: {line: 1, character: 2}
20+
active: {line: 1, character: 2}
21+
marks: {}
22+
finalState:
23+
documentContents: |-
24+
foo:
25+
26+
- 1
27+
selections:
28+
- anchor: {line: 1, character: 2}
29+
active: {line: 1, character: 2}

0 commit comments

Comments
 (0)