Skip to content

Commit f235bda

Browse files
author
fidgetingbits
committed
Initial next gen scope support for shellscript
1 parent 7341d0f commit f235bda

35 files changed

+1062
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change arg
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: argumentOrParameter}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: var="foo ${bar}"
15+
selections:
16+
- anchor: {line: 0, character: 13}
17+
active: {line: 0, character: 13}
18+
marks: {}
19+
finalState:
20+
documentContents: var="foo "
21+
selections:
22+
- anchor: {line: 0, character: 9}
23+
active: {line: 0, character: 9}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change arg
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: argumentOrParameter}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: var="foo $bar"
15+
selections:
16+
- anchor: {line: 0, character: 10}
17+
active: {line: 0, character: 10}
18+
marks: {}
19+
finalState:
20+
documentContents: var="foo "
21+
selections:
22+
- anchor: {line: 0, character: 9}
23+
active: {line: 0, character: 9}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change arg
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: argumentOrParameter}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: echo "foo"
15+
selections:
16+
- anchor: {line: 0, character: 6}
17+
active: {line: 0, character: 6}
18+
marks: {}
19+
finalState:
20+
documentContents: "echo "
21+
selections:
22+
- anchor: {line: 0, character: 5}
23+
active: {line: 0, character: 5}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change arg
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: argumentOrParameter}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: echo "foo" "bar"
15+
selections:
16+
- anchor: {line: 0, character: 15}
17+
active: {line: 0, character: 15}
18+
marks: {}
19+
finalState:
20+
documentContents: "echo \"foo\" "
21+
selections:
22+
- anchor: {line: 0, character: 11}
23+
active: {line: 0, character: 11}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change branch
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: branch}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
if [ "$number" -eq 42 ]; then
16+
echo "The number is 42"
17+
else
18+
echo "The number is not 42"
19+
fi
20+
selections:
21+
- anchor: {line: 3, character: 10}
22+
active: {line: 3, character: 10}
23+
marks: {}
24+
finalState:
25+
documentContents: |-
26+
if [ "$number" -eq 42 ]; then
27+
echo "The number is 42"
28+
fi
29+
selections:
30+
- anchor: {line: 2, character: 0}
31+
active: {line: 2, character: 0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change branch
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: branch}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
if [ "$number" -eq 42 ]; then
16+
echo "The number is 42"
17+
elif [ "$number" -gt 42 ]; then
18+
echo "The number is greater than 42"
19+
else
20+
echo "The number is less than than 42"
21+
fi
22+
selections:
23+
- anchor: {line: 3, character: 10}
24+
active: {line: 3, character: 10}
25+
marks: {}
26+
finalState:
27+
documentContents: |-
28+
if [ "$number" -eq 42 ]; then
29+
echo "The number is 42"
30+
else
31+
echo "The number is less than than 42"
32+
fi
33+
selections:
34+
- anchor: {line: 2, character: 0}
35+
active: {line: 2, character: 0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change call
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: functionCall}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: echo "foo"
15+
selections:
16+
- anchor: {line: 0, character: 10}
17+
active: {line: 0, character: 10}
18+
marks: {}
19+
finalState:
20+
documentContents: ""
21+
selections:
22+
- anchor: {line: 0, character: 0}
23+
active: {line: 0, character: 0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change callee
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: functionCallee}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: echo "foo"
15+
selections:
16+
- anchor: {line: 0, character: 10}
17+
active: {line: 0, character: 10}
18+
marks: {}
19+
finalState:
20+
documentContents: " \"foo\""
21+
selections:
22+
- anchor: {line: 0, character: 0}
23+
active: {line: 0, character: 0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change comment
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: comment}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "# foo"
15+
selections:
16+
- anchor: {line: 0, character: 5}
17+
active: {line: 0, character: 5}
18+
marks: {}
19+
finalState:
20+
documentContents: ""
21+
selections:
22+
- anchor: {line: 0, character: 0}
23+
active: {line: 0, character: 0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change condition
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: condition}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
if [ "$number" -eq 42 ]; then
16+
echo "The number is 42"
17+
else
18+
echo "The number is not 42"
19+
fi
20+
selections:
21+
- anchor: {line: 0, character: 8}
22+
active: {line: 0, character: 8}
23+
marks: {}
24+
finalState:
25+
documentContents: |-
26+
if ; then
27+
echo "The number is 42"
28+
else
29+
echo "The number is not 42"
30+
fi
31+
selections:
32+
- anchor: {line: 0, character: 3}
33+
active: {line: 0, character: 3}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change condition
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: condition}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |
15+
16+
if [["$number" -eq 42 ]]; then
17+
echo "number match"
18+
elif [[ $number -lt 20 ]]; then
19+
echo "< 20"
20+
else
21+
echo "No match"
22+
fi
23+
selections:
24+
- anchor: {line: 4, character: 6}
25+
active: {line: 4, character: 6}
26+
marks: {}
27+
finalState:
28+
documentContents: |
29+
30+
if [["$number" -eq 42 ]]; then
31+
echo "number match"
32+
elif ; then
33+
echo "< 20"
34+
else
35+
echo "No match"
36+
fi
37+
selections:
38+
- anchor: {line: 3, character: 5}
39+
active: {line: 3, character: 5}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change every arg
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: argumentOrParameter}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: echo a b c
15+
selections:
16+
- anchor: {line: 0, character: 10}
17+
active: {line: 0, character: 10}
18+
marks: {}
19+
finalState:
20+
documentContents: "echo "
21+
selections:
22+
- anchor: {line: 0, character: 5}
23+
active: {line: 0, character: 5}
24+
- anchor: {line: 0, character: 6}
25+
active: {line: 0, character: 6}
26+
- anchor: {line: 0, character: 7}
27+
active: {line: 0, character: 7}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
languageId: shellscript
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+
array=("apple" "banana" "cherry")
16+
selections:
17+
- anchor: {line: 0, character: 9}
18+
active: {line: 0, character: 9}
19+
marks: {}
20+
finalState:
21+
documentContents: |
22+
array=( )
23+
selections:
24+
- anchor: {line: 0, character: 7}
25+
active: {line: 0, character: 7}
26+
- anchor: {line: 0, character: 8}
27+
active: {line: 0, character: 8}
28+
- anchor: {line: 0, character: 9}
29+
active: {line: 0, character: 9}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: change funk
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: namedFunction}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
function foo() {
16+
echo "foo"
17+
}
18+
selections:
19+
- anchor: {line: 0, character: 7}
20+
active: {line: 0, character: 7}
21+
marks: {}
22+
finalState:
23+
documentContents: ""
24+
selections:
25+
- anchor: {line: 0, character: 0}
26+
active: {line: 0, character: 0}

0 commit comments

Comments
 (0)