import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; import scopeTests from "./fixtures/java.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 anonymous function, eg a lambda function, an arrow function, etc.
An empty list of arguments in a constructor call. Insertion delimiter should be empty.
A multi-line list of arguments in a constructor call. Insertion delimiter should include a newline.
A single-line list of arguments in a constructor call
An empty list of arguments in a function call. Insertion delimiter should be empty.
An empty list of arguments in an enum constructor call. Insertion delimiter should be empty.
A multi-line list of arguments in an enum constructor call. Insertion delimiter should include a newline.
A single-line list of arguments in an enum constructor call
An empty list of arguments in a method call. Insertion delimiter should be empty.
A multi-line list of arguments in a method call. Insertion delimiter should include a newline.
A single-line list of arguments in a method call
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
An empty list of parameters in a constructor declaration. Insertion delimiter should be empty.
A multi-line list of parameters in a constructor declaration. Insertion delimiter should include a newline.
A single-line list of parameters in a constructor declaration
An empty list of parameters in an anonymous function. Insertion delimiter should be empty.
A multi-line list of parameters in an anonymous function. Insertion delimiter should include a newline.
A single-line list of parameters in an anonymous function
An empty list of parameters in a method declaration. Insertion delimiter should be empty.
A multi-line list of parameters in a method declaration. Insertion delimiter should include a newline.
A single-line list of parameters in a method declaration
A multi-line argument in a constructor call. Insertion delimiter should include a newline.
A single-line argument in a constructor call
A multi-line argument in an enum constructor call. Insertion delimiter should include a newline.
A single-line argument in an enum constructor call
A multi-line argument in a method call. Insertion delimiter should include a newline.
A single-line argument in a method call
A multi-line argument in a function call. Insertion delimiter should include a newline.
A single-line argument in a function call
A parameter in a catch clause
A multi-line parameter in a constructor declaration. Insertion delimiter should include a newline.
A single-line parameter in a constructor declaration
A multi-line parameter in an anonymous function. Insertion delimiter should include a newline.
A single-line parameter in an anonymous function
A multi-line parameter in a method declaration. Insertion delimiter should include a newline.
A single-line parameter in a method declaration
Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call.
Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call..
Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call..
Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call.
Iteration scope for parameters in a constructor declaration: the parameter list. The domain should be the entire constructor.
Iteration scope for parameters in an anonymous function: the parameter list. The domain should be the entire anonymous function.
Iteration scope for parameters in a method declaration: the parameter list. The domain should be the entire method.
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
A try/catch/finally branch
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.
Iteration scope for try/catch/finally branches: the try/catch/finally statement.
A class/struct declaration
Iteration scope for classes: class bodies.
Iteration scope for classes: the entire document including leading and trailing empty lines.
An item in a comma-separated multi-line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include a newline.
An item in a comma-separated single-line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc.
Iteration scope for items in a comma-separated list without enclosing delimiters
A block comment
A line comment
A condition in a do-while loop
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
A chain of function calls, eg foo().bar()
A constructor call
An enum constructor call
A function call with generic type arguments
A method call
The function being called in a function call
The function being called in a chain of function calls, including parent objects.
The class being constructed in a class instantiation, including the new keyword.
The enum constructor being called
The function being called in a function call with generic type arguments
The function being called in a method call, including parent objects.
An if statement
The body of a class/struct declaration
The body of a constructor declaration
The body of a do-while loop
The body of an enum declaration
The body of a for loop
The body of a for-each loop
The body of an if/elif/else branch
The body of an interface declaration
The block body of an anonymous function
The body of a method declaration
The body of a resource management statement, eg with / use / using
The body of a static initialization block in a class
The body of a switch statement
The body of a case/default branch in a switch statement
The body of a try/catch/finally branch
The body of a while loop
A list/array
Name of a parameter in a catch clause
Name of a parameter in a constructor declaration
Name of a parameter in an anonymous function
Name of a parameter in a method declaration
Name (LHS) of an assignment statement
Name (LHS) of a compound assignment statement, eg +=/-=
Name of a class/struct declaration
Name (LHS) of a constant declaration
Name of a constructor declaration
Name of an enum declaration
Name (LHS) of a field declaration in a class/struct
Name (LHS) of a field declaration in an enum
Name (LHS) of a field declaration in an interface
Iteration variable name in a for-each loop
Name of an interface declaration
Name of a method declaration
Name of a method declaration in an interface
Name in a resource management statement, eg with / use / using
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: class bodies.
Iteration scope for names: the entire document including leading and trailing empty lines.
Iteration scope for names: enum bodies.
Iteration scope for names: interface bodies.
Iteration scope for names of parameters in a constructor declaration: the parameter list.
Iteration scope for names of parameters in an anonymous function: the parameter list.
Iteration scope for names of parameters in a method declaration: the parameter list.
A constructor declaration
A method declaration
Iteration scope for named functions: class bodies.
An assignment statement
A compound assignment statement, eg +=/-=
A break statement
A class/struct declaration
A constant declaration
A constructor declaration
A continue statement
A do-while loop
An enum declaration
A field declaration in a class/struct
A field declaration in an interface
A for loop
A for-each loop
A function call statement
An if/elif/else statement
An import statement
An interface declaration
A method declaration
A method declaration in an interface
A miscellaneous statement
A package declaration
A resource management statement, eg with / use / using
A return statement
A static initialization block in a class, eg static { ... }
A switch statement
A throw statement
A try/catch/finally statement
An update statement, eg ++/--
An initialized variable declaration
An uninitialized variable declaration
A while loop
A yield statement
Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc).
Iteration scope for statements: class bodies.
Iteration scope for statements: the entire document including leading and trailing empty lines.
Iteration scope for statements: interface bodies.
Type of a parameter in a catch clause
Type of a parameter in a constructor declaration
Type of a parameter in an anonymous function
Type of a parameter in a method declaration
A type cast
A class/struct declaration
Type of a constant declaration
An enum declaration
Type of a field declaration in a class/struct
Type of a field declaration in an interface
Type of a variable in a for-each loop
An interface declaration
Type in a resource management statement, eg with / use / using
Type of a return value in a method declaration
Type argument to a generic / parametrized type
Type of an initialized variable declaration
Type of an uninitialized variable declaration
Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc).
Iteration scope for types: class bodies.
Iteration scope for types: the entire document including leading and trailing empty lines.
Iteration scope for types: interface bodies.
Iteration scope for types of parameters in a constructor declaration: the parameter list.
Iteration scope for types of parameters in an anonymous function: the parameter list.
Iteration scope for types of parameters in a method declaration: the parameter list.
Iteration scope for type arguments to a generic / parametrized type: the type argument list.
Value (RHS) of an assignment statement
Value (RHS) of a compound assignment statement, eg +=/-=
Value (RHS) of a constant declaration
Value (RHS) of a field declaration in a class/struct
Value (RHS) of a field declaration in an interface
Iterable in a for-each loop
Value of a resource management statement, eg