import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; import scopeTests from "./fixtures/shellscript.json";
Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint.
An empty list of arguments in a function call. Insertion delimiter should be empty.
A multi-line list of arguments in a function call. Insertion delimiter should include a newline.
A single-line list of arguments in a function call
A multi-line argument in a function call. Insertion delimiter should include a newline.
A single-line argument in a function call
Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call.
An if branch
An if-elif-else branch. The removal range for the if branch should include the trailing else keyword.
An if-else branch
A case/default branch in a switch statement
A branch in a ternary expression
Iteration scope for if/elif/else branches: the if/elif/else statement.
Iteration scope for case/default branches in a switch statement: the switch statement body.
Iteration scope for ternary expression branches: the ternary expression.
Key (LHS) of a key-value pair in a map
Iteration scope for keys of key-value pairs in a map: should be between the braces.
A line comment
A condition in a for loop
A condition in an if statement
A condition in a switch statement
A condition in a ternary expression
A condition in a while loop
Iteration scope for conditions in a switch statement: the switch statement body.
A function call
The function being called in a function call
An if statement
The body of a for loop
The body of a for-each loop
The body of a function declaration
The body of an if/elif/else branch
The body of a switch statement
The body of a case/default branch in a switch statement
The body of a while loop
A list/array
A map/dictionary
Name (LHS) of an assignment statement
Name (LHS) of a compound assignment statement, eg +=/-=
Name (LHS) of a constant declaration
Iteration variable name in a for-each loop
Name of a function declaration
Name (LHS) of an initialized variable declaration
Name (LHS) of an uninitialized variable declaration
Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc).
Iteration scope for names: the entire document including leading and trailing empty lines.
A named function declaration
Iteration scope for named functions: the entire document including leading and trailing empty lines.
A regular expression
An assignment statement
A compound assignment statement, eg +=/-=
A break statement
A constant declaration
A continue statement
A for loop
A for-each loop
A named function declaration
A function call statement
An if/elif/else statement
An import statement
A return statement
A switch statement
An update statement, eg ++/--
An initialized variable declaration
An uninitialized variable declaration
A while loop
Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc).
Iteration scope for statements: the entire document including leading and trailing empty lines.
Value (RHS) of an assignment statement
Value (RHS) of a compound assignment statement, eg +=/-=
Value (RHS) of a constant declaration
Iterable in a for-each loop
Value (RHS) of a key-value pair in a map
Return value of a function
Value / subject of a switch statement
Value (RHS) of a variable declaration
Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc).
Iteration scope for values: the entire document including leading and trailing empty lines.
Iteration scope for values of key-value pairs in a map: should be between the braces.
The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality.
A multi-line string
A single-line string
Internally used text fragment consisting of a line comment
Internally used text fragment consisting of a regular expression literal pattern
Internally used text fragment consisting of a multi-line string
Internally used text fragment consisting of a single-line string