Skip to content

Commit d93ca9c

Browse files
Added additional shellscript scope fixtures (#3353)
1 parent 79aee42 commit d93ca9c

47 files changed

Lines changed: 2134 additions & 16 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json‎

Lines changed: 636 additions & 0 deletions
Large diffs are not rendered by default.

‎packages/app-web-docs/src/docs/user/languages/shellscript.mdx‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Below are visualizations of all our scope tests for this language. These were cr
7979

8080
<ScopeVisualizer fixtureName="scopes/shellscript/branch/branch.switchCase2" languageId="shellscript" />
8181

82+
<ScopeVisualizer fixtureName="scopes/shellscript/branch/branch.switchCase3" languageId="shellscript" />
83+
8284
#### 5. Branch: Ternary
8385

8486
<i>A branch in a ternary expression</i>
@@ -111,12 +113,18 @@ Below are visualizations of all our scope tests for this language. These were cr
111113

112114
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair" languageId="shellscript" />
113115

116+
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair2" languageId="shellscript" />
117+
118+
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair3" languageId="shellscript" />
119+
114120
#### 2. Key: Map pair (iteration)
115121

116122
<i>Iteration scope for keys of key-value pairs in a map: should be between the braces.</i>
117123

118124
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair.iteration" languageId="shellscript" />
119125

126+
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair.iteration2" languageId="shellscript" />
127+
120128
### Comment
121129

122130
#### 1. Comment: Line
@@ -145,6 +153,10 @@ Below are visualizations of all our scope tests for this language. These were cr
145153

146154
<ScopeVisualizer fixtureName="scopes/shellscript/condition/condition.switchCase" languageId="shellscript" />
147155

156+
<ScopeVisualizer fixtureName="scopes/shellscript/condition/condition.switchCase2" languageId="shellscript" />
157+
158+
<ScopeVisualizer fixtureName="scopes/shellscript/condition/condition.switchCase3" languageId="shellscript" />
159+
148160
#### 4. Condition: Ternary
149161

150162
<i>A condition in a ternary expression</i>
@@ -215,6 +227,8 @@ Below are visualizations of all our scope tests for this language. These were cr
215227

216228
<ScopeVisualizer fixtureName="scopes/shellscript/interior/interior.function2" languageId="shellscript" />
217229

230+
<ScopeVisualizer fixtureName="scopes/shellscript/interior/interior.function3" languageId="shellscript" />
231+
218232
#### 4. Interior: If
219233

220234
<i>The body of an if/elif/else branch</i>
@@ -233,6 +247,8 @@ Below are visualizations of all our scope tests for this language. These were cr
233247

234248
<ScopeVisualizer fixtureName="scopes/shellscript/interior/interior.switchCase" languageId="shellscript" />
235249

250+
<ScopeVisualizer fixtureName="scopes/shellscript/interior/interior.switchCase2" languageId="shellscript" />
251+
236252
#### 7. Interior: While
237253

238254
<i>The body of a while loop</i>
@@ -249,6 +265,8 @@ Below are visualizations of all our scope tests for this language. These were cr
249265

250266
<ScopeVisualizer fixtureName="scopes/shellscript/list" languageId="shellscript" />
251267

268+
<ScopeVisualizer fixtureName="scopes/shellscript/list2" languageId="shellscript" />
269+
252270
### Map
253271

254272
#### 1. Map
@@ -257,6 +275,10 @@ Below are visualizations of all our scope tests for this language. These were cr
257275

258276
<ScopeVisualizer fixtureName="scopes/shellscript/map" languageId="shellscript" />
259277

278+
<ScopeVisualizer fixtureName="scopes/shellscript/map2" languageId="shellscript" />
279+
280+
<ScopeVisualizer fixtureName="scopes/shellscript/map3" languageId="shellscript" />
281+
260282
### Name
261283

262284
#### 1. Name: Assignment
@@ -319,6 +341,8 @@ Below are visualizations of all our scope tests for this language. These were cr
319341

320342
<ScopeVisualizer fixtureName="scopes/shellscript/name/name.iteration.block4" languageId="shellscript" />
321343

344+
<ScopeVisualizer fixtureName="scopes/shellscript/name/name.iteration.block5" languageId="shellscript" />
345+
322346
#### 9. Name (iteration document)
323347

324348
<i>Iteration scope for names: the entire document including leading and trailing empty lines.</i>
@@ -337,6 +361,8 @@ Below are visualizations of all our scope tests for this language. These were cr
337361

338362
<ScopeVisualizer fixtureName="scopes/shellscript/namedFunction/namedFunction3" languageId="shellscript" />
339363

364+
<ScopeVisualizer fixtureName="scopes/shellscript/namedFunction/namedFunction4" languageId="shellscript" />
365+
340366
#### 2. Named function (iteration document)
341367

342368
<i>Iteration scope for named functions: the entire document including leading and trailing empty lines.</i>
@@ -403,6 +429,10 @@ Below are visualizations of all our scope tests for this language. These were cr
403429

404430
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.function2" languageId="shellscript" />
405431

432+
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.function3" languageId="shellscript" />
433+
434+
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.function4" languageId="shellscript" />
435+
406436
#### 9. Statement: Function call
407437

408438
<i>A function call statement</i>
@@ -411,6 +441,12 @@ Below are visualizations of all our scope tests for this language. These were cr
411441

412442
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.functionCall2" languageId="shellscript" />
413443

444+
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.functionCall3" languageId="shellscript" />
445+
446+
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.functionCall4" languageId="shellscript" />
447+
448+
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.functionCall5" languageId="shellscript" />
449+
414450
#### 10. Statement: If
415451

416452
<i>An if/elif/else statement</i>
@@ -479,6 +515,8 @@ Below are visualizations of all our scope tests for this language. These were cr
479515

480516
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.iteration.block4" languageId="shellscript" />
481517

518+
<ScopeVisualizer fixtureName="scopes/shellscript/statement/statement.iteration.block5" languageId="shellscript" />
519+
482520
#### 19. Statement (iteration document)
483521

484522
<i>Iteration scope for statements: the entire document including leading and trailing empty lines.</i>
@@ -511,12 +549,18 @@ Below are visualizations of all our scope tests for this language. These were cr
511549

512550
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.foreach" languageId="shellscript" />
513551

552+
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.foreach2" languageId="shellscript" />
553+
514554
#### 5. Value: Map pair
515555

516556
<i>Value (RHS) of a key-value pair in a map</i>
517557

518558
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.mapPair" languageId="shellscript" />
519559

560+
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.mapPair2" languageId="shellscript" />
561+
562+
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.mapPair3" languageId="shellscript" />
563+
520564
#### 6. Value: Return
521565

522566
<i>Return value of a function</i>
@@ -551,6 +595,8 @@ Below are visualizations of all our scope tests for this language. These were cr
551595

552596
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.iteration.block4" languageId="shellscript" />
553597

598+
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.iteration.block5" languageId="shellscript" />
599+
554600
#### 10. Value (iteration document)
555601

556602
<i>Iteration scope for values: the entire document including leading and trailing empty lines.</i>
@@ -563,6 +609,8 @@ Below are visualizations of all our scope tests for this language. These were cr
563609

564610
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.mapPair.iteration" languageId="shellscript" />
565611

612+
<ScopeVisualizer fixtureName="scopes/shellscript/value/value.mapPair.iteration2" languageId="shellscript" />
613+
566614
## Internal scopes
567615

568616
The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality.

‎packages/app-web-docs/src/docs/user/scopes/branch.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ Default: `branch`
333333

334334
<ScopeVisualizer fixtureName="scopes/shellscript/branch/branch.switchCase2" />
335335

336+
<ScopeVisualizer fixtureName="scopes/shellscript/branch/branch.switchCase3" />
337+
336338
### Branch: Ternary
337339

338340
<i>A branch in a ternary expression</i>

‎packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ Default: `key`
111111

112112
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair" />
113113

114+
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair2" />
115+
116+
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair3" />
117+
114118
##### Talon list
115119

116120
<ScopeVisualizer fixtureName="scopes/talon-list/key.mapPair" />
@@ -189,6 +193,8 @@ Default: `key`
189193

190194
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair.iteration" />
191195

196+
<ScopeVisualizer fixtureName="scopes/shellscript/key.mapPair.iteration2" />
197+
192198
##### Talon list
193199

194200
<ScopeVisualizer fixtureName="scopes/talon-list/key.mapPair.iteration" />

‎packages/app-web-docs/src/docs/user/scopes/condition.mdx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ Default: `condition`
265265

266266
<ScopeVisualizer fixtureName="scopes/shellscript/condition/condition.switchCase" />
267267

268+
<ScopeVisualizer fixtureName="scopes/shellscript/condition/condition.switchCase2" />
269+
270+
<ScopeVisualizer fixtureName="scopes/shellscript/condition/condition.switchCase3" />
271+
268272
### Condition: Ternary
269273

270274
<i>A condition in a ternary expression</i>

‎packages/app-web-docs/src/docs/user/scopes/fixtures/branch.json‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,6 +3318,41 @@
33183318
}
33193319
]
33203320
},
3321+
{
3322+
"name": "scopes/shellscript/branch/branch.switchCase3",
3323+
"languageId": "shellscript",
3324+
"facet": "branch.switchCase",
3325+
"code": "case $foo in\n 0) : ;&\n 1) : ;;&\n *) : ;;\nesac",
3326+
"scopes": [
3327+
{
3328+
"targets": [
3329+
{
3330+
"content": "1:2-1:9",
3331+
"removal": "1:0-2:0"
3332+
}
3333+
],
3334+
"domain": "1:2-1:9"
3335+
},
3336+
{
3337+
"targets": [
3338+
{
3339+
"content": "2:2-2:10",
3340+
"removal": "2:0-3:0"
3341+
}
3342+
],
3343+
"domain": "2:2-2:10"
3344+
},
3345+
{
3346+
"targets": [
3347+
{
3348+
"content": "3:2-3:9",
3349+
"removal": "3:0-4:0"
3350+
}
3351+
],
3352+
"domain": "3:2-3:9"
3353+
}
3354+
]
3355+
},
33213356
{
33223357
"name": "scopes/shellscript/branch/branch.ternary.iteration",
33233358
"languageId": "shellscript",

‎packages/app-web-docs/src/docs/user/scopes/fixtures/collectionKey.json‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,22 @@
687687
}
688688
]
689689
},
690+
{
691+
"name": "scopes/shellscript/key.mapPair.iteration2",
692+
"languageId": "shellscript",
693+
"facet": "key.mapPair.iteration",
694+
"code": "foo=(\"aaa\"$bar bbb)\nbar=([\"aaa\"] bbb)\nbaz=(\"[aaa]=0\" bbb)\nbongo=([\"aaa\"]=0)",
695+
"scopes": [
696+
{
697+
"targets": [
698+
{
699+
"content": "3:7-3:16"
700+
}
701+
],
702+
"domain": "3:7-3:16"
703+
}
704+
]
705+
},
690706
{
691707
"name": "scopes/shellscript/key.mapPair",
692708
"languageId": "shellscript",
@@ -713,6 +729,40 @@
713729
}
714730
]
715731
},
732+
{
733+
"name": "scopes/shellscript/key.mapPair2",
734+
"languageId": "shellscript",
735+
"facet": "key.mapPair",
736+
"code": "foo=(\"aaa\"$bar bbb)\nbar=([\"aaa\"] bbb)\nbaz=(\"[aaa]=0\" bbb)\nbongo=([\"aaa\"]=0)",
737+
"scopes": [
738+
{
739+
"targets": [
740+
{
741+
"content": "3:8-3:13",
742+
"removal": "3:8-3:13"
743+
}
744+
],
745+
"domain": "3:7-3:16"
746+
}
747+
]
748+
},
749+
{
750+
"name": "scopes/shellscript/key.mapPair3",
751+
"languageId": "shellscript",
752+
"facet": "key.mapPair",
753+
"code": "foo=([\"aaa\"]=\"bbb\"$bar)",
754+
"scopes": [
755+
{
756+
"targets": [
757+
{
758+
"content": "0:6-0:11",
759+
"removal": "0:6-0:11"
760+
}
761+
],
762+
"domain": "0:5-0:22"
763+
}
764+
]
765+
},
716766
{
717767
"name": "scopes/talon/key/key.mapPair.iteration",
718768
"languageId": "talon",

‎packages/app-web-docs/src/docs/user/scopes/fixtures/condition.json‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,58 @@
17931793
}
17941794
]
17951795
},
1796+
{
1797+
"name": "scopes/shellscript/condition/condition.switchCase2",
1798+
"languageId": "shellscript",
1799+
"facet": "condition.switchCase",
1800+
"code": "case $foo in\n 0|1|2) : ;;\nesac",
1801+
"scopes": [
1802+
{
1803+
"targets": [
1804+
{
1805+
"content": "1:2-1:7",
1806+
"removal": "1:0-1:7"
1807+
}
1808+
],
1809+
"domain": "1:2-1:13"
1810+
}
1811+
]
1812+
},
1813+
{
1814+
"name": "scopes/shellscript/condition/condition.switchCase3",
1815+
"languageId": "shellscript",
1816+
"facet": "condition.switchCase",
1817+
"code": "case $foo in\n 0) : ;&\n 1) : ;;&\n *) : ;;\nesac",
1818+
"scopes": [
1819+
{
1820+
"targets": [
1821+
{
1822+
"content": "1:2-1:3",
1823+
"removal": "1:0-1:3"
1824+
}
1825+
],
1826+
"domain": "1:2-1:9"
1827+
},
1828+
{
1829+
"targets": [
1830+
{
1831+
"content": "2:2-2:3",
1832+
"removal": "2:0-2:3"
1833+
}
1834+
],
1835+
"domain": "2:2-2:10"
1836+
},
1837+
{
1838+
"targets": [
1839+
{
1840+
"content": "3:2-3:3",
1841+
"removal": "3:0-3:3"
1842+
}
1843+
],
1844+
"domain": "3:2-3:9"
1845+
}
1846+
]
1847+
},
17961848
{
17971849
"name": "scopes/shellscript/condition/condition.ternary",
17981850
"languageId": "shellscript",

0 commit comments

Comments
 (0)