Skip to content

Commit b492207

Browse files
committed
Rename snippets
1 parent edf04ba commit b492207

32 files changed

+557
-282
lines changed

images/tryWrapFine.gif

45.4 KB
Loading

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,16 +406,16 @@
406406
"type": "object",
407407
"scope": "language-overridable",
408408
"default": {
409-
"cursorless.wrapper.ifStatement": {
409+
"cursorless.wrappers.ifStatement": {
410410
"scopeType": "statement"
411411
},
412-
"cursorless.wrapper.tryCatchStatement": {
412+
"cursorless.wrappers.tryCatchStatement": {
413413
"scopeType": "statement"
414414
},
415-
"cursorless.wrapper.ifElseStatementIfBranch": {
415+
"cursorless.wrappers.ifElseStatementIfBranch": {
416416
"scopeType": "statement"
417417
},
418-
"cursorless.wrapper.ifElseStatementElseBranch": {
418+
"cursorless.wrappers.ifElseStatementElseBranch": {
419419
"scopeType": "statement"
420420
}
421421
},

snippets/cpp.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"cursorless.wrapper.ifStatement": {
2+
"cursorless.wrappers.ifStatement": {
33
"body": [
44
"if ($1) {\n\t$TM_SELECTED_TEXT\n}"
55
],
66
"description": "For wrapping selection in if statement"
77
},
8-
"cursorless.wrapper.tryCatchStatement": {
8+
"cursorless.wrappers.tryCatchStatement": {
99
"body": [
1010
"try {\n\t$TM_SELECTED_TEXT\n} catch ($1) {\n\t$0\n}"
1111
],
1212
"description": "For wrapping selection in try-catch statement"
1313
},
14-
"cursorless.wrapper.ifElseStatementIfBranch": {
14+
"cursorless.wrappers.ifElseStatementIfBranch": {
1515
"body": [
1616
"if ($1) {\n\t$TM_SELECTED_TEXT\n} else {\n\t$0\n}"
1717
],
1818
"description": "For wrapping selection in if branch of if-else statement"
1919
},
20-
"cursorless.wrapper.ifElseStatementElseBranch": {
20+
"cursorless.wrappers.ifElseStatementElseBranch": {
2121
"body": [
2222
"if ($1) {\n\t$0\n} else {\n\t$TM_SELECTED_TEXT\n}"
2323
],

snippets/csharp.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"cursorless.wrapper.ifStatement": {
2+
"cursorless.wrappers.ifStatement": {
33
"body": [
44
"if ($1) {\n\t$TM_SELECTED_TEXT\n}"
55
],
66
"description": "For wrapping selection in if statement"
77
},
8-
"cursorless.wrapper.tryCatchStatement": {
8+
"cursorless.wrappers.tryCatchStatement": {
99
"body": [
1010
"try {\n\t$TM_SELECTED_TEXT\n} catch ($1) {\n\t$0\n}"
1111
],
1212
"description": "For wrapping selection in try-catch statement"
1313
},
14-
"cursorless.wrapper.ifElseStatementIfBranch": {
14+
"cursorless.wrappers.ifElseStatementIfBranch": {
1515
"body": [
1616
"if ($1) {\n\t$TM_SELECTED_TEXT\n} else {\n\t$0\n}"
1717
],
1818
"description": "For wrapping selection in if branch of if-else statement"
1919
},
20-
"cursorless.wrapper.ifElseStatementElseBranch": {
20+
"cursorless.wrappers.ifElseStatementElseBranch": {
2121
"body": [
2222
"if ($1) {\n\t$0\n} else {\n\t$TM_SELECTED_TEXT\n}"
2323
],

snippets/java.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"cursorless.wrapper.ifStatement": {
2+
"cursorless.wrappers.ifStatement": {
33
"body": [
44
"if ($1) {\n\t$TM_SELECTED_TEXT\n}"
55
],
66
"description": "For wrapping selection in if statement"
77
},
8-
"cursorless.wrapper.tryCatchStatement": {
8+
"cursorless.wrappers.tryCatchStatement": {
99
"body": [
1010
"try {\n\t$TM_SELECTED_TEXT\n} catch ($1) {\n\t$0\n}"
1111
],
1212
"description": "For wrapping selection in try-catch statement"
1313
},
14-
"cursorless.wrapper.ifElseStatementIfBranch": {
14+
"cursorless.wrappers.ifElseStatementIfBranch": {
1515
"body": [
1616
"if ($1) {\n\t$TM_SELECTED_TEXT\n} else {\n\t$0\n}"
1717
],
1818
"description": "For wrapping selection in if branch of if-else statement"
1919
},
20-
"cursorless.wrapper.ifElseStatementElseBranch": {
20+
"cursorless.wrappers.ifElseStatementElseBranch": {
2121
"body": [
2222
"if ($1) {\n\t$0\n} else {\n\t$TM_SELECTED_TEXT\n}"
2323
],

snippets/python.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"cursorless.wrapper.ifStatement": {
2+
"cursorless.wrappers.ifStatement": {
33
"body": [
44
"if $1:\n\t$TM_SELECTED_TEXT"
55
],
66
"description": "For wrapping selection in if statement"
77
},
8-
"cursorless.wrapper.tryCatchStatement": {
8+
"cursorless.wrappers.tryCatchStatement": {
99
"body": [
1010
"try:\n\t$TM_SELECTED_TEXT\nexcept $1:\n\t"
1111
],
1212
"description": "For wrapping selection in try-catch statement"
1313
},
14-
"cursorless.wrapper.ifElseStatementIfBranch": {
14+
"cursorless.wrappers.ifElseStatementIfBranch": {
1515
"body": [
1616
"if $1:\n\t$TM_SELECTED_TEXT\nelse:\n\t"
1717
],
1818
"description": "For wrapping selection in if branch of if-else statement"
1919
},
20-
"cursorless.wrapper.ifElseStatementElseBranch": {
20+
"cursorless.wrappers.ifElseStatementElseBranch": {
2121
"body": [
2222
"if $1:\n\t$0\nelse:\n\t$TM_SELECTED_TEXT"
2323
],

snippets/typescript.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"cursorless.wrapper.ifStatement": {
2+
"cursorless.wrappers.ifStatement": {
33
"body": [
44
"if ($1) {\n\t$TM_SELECTED_TEXT\n}"
55
],
66
"description": "For wrapping selection in if statement"
77
},
8-
"cursorless.wrapper.tryCatchStatement": {
8+
"cursorless.wrappers.tryCatchStatement": {
99
"body": [
1010
"try {\n\t$TM_SELECTED_TEXT\n} catch ($1) {\n\t$0\n}"
1111
],
1212
"description": "For wrapping selection in try-catch statement"
1313
},
14-
"cursorless.wrapper.ifElseStatementIfBranch": {
14+
"cursorless.wrappers.ifElseStatementIfBranch": {
1515
"body": [
1616
"if ($1) {\n\t$TM_SELECTED_TEXT\n} else {\n\t$0\n}"
1717
],
1818
"description": "For wrapping selection in if branch of if-else statement"
1919
},
20-
"cursorless.wrapper.ifElseStatementElseBranch": {
20+
"cursorless.wrappers.ifElseStatementElseBranch": {
2121
"body": [
2222
"if ($1) {\n\t$0\n} else {\n\t$TM_SELECTED_TEXT\n}"
2323
],

src/test/suite/fixtures/recorded/languages/cpp/elseStateWrapThis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ command:
44
actionName: wrapWithSnippet
55
partialTargets:
66
- type: primitive
7-
mark: {type: cursor}
8-
extraArgs: [cursorless.wrapper.ifElseStatementElseBranch]
7+
mark: { type: cursor }
8+
extraArgs: [cursorless.wrappers.ifElseStatementElseBranch]
99
marks: {}
1010
initialState:
1111
documentContents: int foo = 0;
1212
selections:
13-
- anchor: {line: 0, character: 6}
14-
active: {line: 0, character: 6}
13+
- anchor: { line: 0, character: 6 }
14+
active: { line: 0, character: 6 }
1515
finalState:
1616
documentContents: |-
1717
if () {
@@ -20,9 +20,20 @@ finalState:
2020
int foo = 0;
2121
}
2222
selections:
23-
- anchor: {line: 0, character: 4}
24-
active: {line: 0, character: 4}
23+
- anchor: { line: 0, character: 4 }
24+
active: { line: 0, character: 4 }
2525
thatMark:
26-
- anchor: {line: 0, character: 0}
27-
active: {line: 4, character: 1}
28-
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: statement, includeSiblings: false}}]
26+
- anchor: { line: 0, character: 0 }
27+
active: { line: 4, character: 1 }
28+
fullTargets:
29+
[
30+
{
31+
type: primitive,
32+
mark: { type: cursor },
33+
selectionType: token,
34+
position: contents,
35+
insideOutsideType: inside,
36+
modifier:
37+
{ type: containingScope, scopeType: statement, includeSiblings: false },
38+
},
39+
]

src/test/suite/fixtures/recorded/languages/cpp/ifElseWrapThis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ command:
44
actionName: wrapWithSnippet
55
partialTargets:
66
- type: primitive
7-
mark: {type: cursor}
8-
extraArgs: [cursorless.wrapper.ifElseStatementIfBranch]
7+
mark: { type: cursor }
8+
extraArgs: [cursorless.wrappers.ifElseStatementIfBranch]
99
marks: {}
1010
initialState:
1111
documentContents: int foo = 0;
1212
selections:
13-
- anchor: {line: 0, character: 6}
14-
active: {line: 0, character: 6}
13+
- anchor: { line: 0, character: 6 }
14+
active: { line: 0, character: 6 }
1515
finalState:
1616
documentContents: |-
1717
if () {
@@ -20,9 +20,20 @@ finalState:
2020
2121
}
2222
selections:
23-
- anchor: {line: 0, character: 4}
24-
active: {line: 0, character: 4}
23+
- anchor: { line: 0, character: 4 }
24+
active: { line: 0, character: 4 }
2525
thatMark:
26-
- anchor: {line: 0, character: 0}
27-
active: {line: 4, character: 1}
28-
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: statement, includeSiblings: false}}]
26+
- anchor: { line: 0, character: 0 }
27+
active: { line: 4, character: 1 }
28+
fullTargets:
29+
[
30+
{
31+
type: primitive,
32+
mark: { type: cursor },
33+
selectionType: token,
34+
position: contents,
35+
insideOutsideType: inside,
36+
modifier:
37+
{ type: containingScope, scopeType: statement, includeSiblings: false },
38+
},
39+
]

src/test/suite/fixtures/recorded/languages/cpp/ifStateWrapThis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,34 @@ command:
44
actionName: wrapWithSnippet
55
partialTargets:
66
- type: primitive
7-
mark: {type: cursor}
8-
extraArgs: [cursorless.wrapper.ifStatement]
7+
mark: { type: cursor }
8+
extraArgs: [cursorless.wrappers.ifStatement]
99
marks: {}
1010
initialState:
1111
documentContents: int foo = 0;
1212
selections:
13-
- anchor: {line: 0, character: 6}
14-
active: {line: 0, character: 6}
13+
- anchor: { line: 0, character: 6 }
14+
active: { line: 0, character: 6 }
1515
finalState:
1616
documentContents: |-
1717
if () {
1818
int foo = 0;
1919
}
2020
selections:
21-
- anchor: {line: 0, character: 4}
22-
active: {line: 0, character: 4}
21+
- anchor: { line: 0, character: 4 }
22+
active: { line: 0, character: 4 }
2323
thatMark:
24-
- anchor: {line: 0, character: 0}
25-
active: {line: 2, character: 1}
26-
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: statement, includeSiblings: false}}]
24+
- anchor: { line: 0, character: 0 }
25+
active: { line: 2, character: 1 }
26+
fullTargets:
27+
[
28+
{
29+
type: primitive,
30+
mark: { type: cursor },
31+
selectionType: token,
32+
position: contents,
33+
insideOutsideType: inside,
34+
modifier:
35+
{ type: containingScope, scopeType: statement, includeSiblings: false },
36+
},
37+
]

src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ command:
44
actionName: wrapWithSnippet
55
partialTargets:
66
- type: primitive
7-
mark: {type: cursor}
8-
extraArgs: [cursorless.wrapper.tryCatchStatement]
7+
mark: { type: cursor }
8+
extraArgs: [cursorless.wrappers.tryCatchStatement]
99
marks: {}
1010
initialState:
1111
documentContents: int foo = 0;
1212
selections:
13-
- anchor: {line: 0, character: 6}
14-
active: {line: 0, character: 6}
13+
- anchor: { line: 0, character: 6 }
14+
active: { line: 0, character: 6 }
1515
finalState:
1616
documentContents: |-
1717
try {
@@ -20,9 +20,20 @@ finalState:
2020
2121
}
2222
selections:
23-
- anchor: {line: 2, character: 9}
24-
active: {line: 2, character: 9}
23+
- anchor: { line: 2, character: 9 }
24+
active: { line: 2, character: 9 }
2525
thatMark:
26-
- anchor: {line: 0, character: 0}
27-
active: {line: 4, character: 1}
28-
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: statement, includeSiblings: false}}]
26+
- anchor: { line: 0, character: 0 }
27+
active: { line: 4, character: 1 }
28+
fullTargets:
29+
[
30+
{
31+
type: primitive,
32+
mark: { type: cursor },
33+
selectionType: token,
34+
position: contents,
35+
insideOutsideType: inside,
36+
modifier:
37+
{ type: containingScope, scopeType: statement, includeSiblings: false },
38+
},
39+
]

src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis2.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ command:
44
actionName: wrapWithSnippet
55
partialTargets:
66
- type: primitive
7-
mark: {type: cursor}
8-
extraArgs: [cursorless.wrapper.tryCatchStatement]
7+
mark: { type: cursor }
8+
extraArgs: [cursorless.wrappers.tryCatchStatement]
99
marks: {}
1010
initialState:
1111
documentContents: |-
@@ -15,10 +15,10 @@ initialState:
1515
1616
int bar = 1;
1717
selections:
18-
- anchor: {line: 4, character: 0}
19-
active: {line: 4, character: 0}
20-
- anchor: {line: 0, character: 0}
21-
active: {line: 0, character: 0}
18+
- anchor: { line: 4, character: 0 }
19+
active: { line: 4, character: 0 }
20+
- anchor: { line: 0, character: 0 }
21+
active: { line: 0, character: 0 }
2222
finalState:
2323
documentContents: |-
2424
try {
@@ -35,13 +35,24 @@ finalState:
3535
3636
}
3737
selections:
38-
- anchor: {line: 10, character: 9}
39-
active: {line: 10, character: 9}
40-
- anchor: {line: 4, character: 9}
41-
active: {line: 4, character: 9}
38+
- anchor: { line: 10, character: 9 }
39+
active: { line: 10, character: 9 }
40+
- anchor: { line: 4, character: 9 }
41+
active: { line: 4, character: 9 }
4242
thatMark:
43-
- anchor: {line: 8, character: 0}
44-
active: {line: 12, character: 1}
45-
- anchor: {line: 0, character: 0}
46-
active: {line: 6, character: 1}
47-
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: statement, includeSiblings: false}}]
43+
- anchor: { line: 8, character: 0 }
44+
active: { line: 12, character: 1 }
45+
- anchor: { line: 0, character: 0 }
46+
active: { line: 6, character: 1 }
47+
fullTargets:
48+
[
49+
{
50+
type: primitive,
51+
mark: { type: cursor },
52+
selectionType: token,
53+
position: contents,
54+
insideOutsideType: inside,
55+
modifier:
56+
{ type: containingScope, scopeType: statement, includeSiblings: false },
57+
},
58+
]

0 commit comments

Comments
 (0)