ArrayAccessExprContext
Required to prevent recursive access to the "parent node" (not necessarily the same as the "parent context").
Consider, for example, this code where the cursor is currently at the node of type ArrayAccessExpr:
var1.perPriority[index].recovered
^^^^^^^^^^^^^^^^^^^^^^^ - ArrayAccessExpr
Content copied to clipboard
The AST for this snippet:
FieldAccessExpr // This FieldAccessExpr is accessing the field `recovered`
/ \
**ArrayAccessExpr** SimpleName(recovered)
/ \
FieldAccessExpr NameExpr(index) // This FieldAccessExpr is accessing the field `perPriority`
/ \
NameExpr(var1) SimpleName (perPriority)
Content copied to clipboard
In this example:
- The parent node for
ArrayAccessExprisFieldAccessExpr(variable1.perPriority[index].recovered).// "Parent Node" of the ArrayAccessExpr var.perPriority[index].recovered ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - FieldAccessExpr ^^^^^^^^^^^^^^^^^^^^^^ - ArrayAccessExpr ^^^^^^^^^ - SimpleNameContent copied to clipboard - The parent context is the
FieldAccessExprto the left of the outer array-access, which is actually a child node.// "Parent Context" of the ArrayAccessExpr var1.perPriority[index].recovered ^^^^^^^^^^^^^^^^^^^^^^^ - ArrayAccessExpr ^^^^^^^^^^^^^^^^ - FieldAccessExpr ^^^^^ - NameExprContent copied to clipboard
Author
Roger Howell
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun findExposedPatternInParentContext(parent: Node, name: String): SymbolReference<out ResolvedValueDeclaration>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun solveConstructor(argumentsTypes: List<ResolvedType>): SymbolReference<ResolvedConstructorDeclaration>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun solveMethod(name: String, argumentsTypes: List<ResolvedType>, staticOnly: Boolean, invocationContext: ResolvedReferenceTypeDeclaration): SymbolReference<ResolvedMethodDeclaration>
Link copied to clipboard
abstract fun solveMethodAsUsage(name: String, argumentsTypes: List<ResolvedType>, invocationContext: ResolvedReferenceTypeDeclaration): Optional<MethodUsage>
open fun solveMethodAsUsage(name: String, argumentsTypes: List<ResolvedType>, invocationContext: ResolvedReferenceTypeDeclaration): Optional<MethodUsage>
Similar to solveMethod but we return a MethodUsage.
Link copied to clipboard
open fun solveMethodInParentContext(name: String, argumentsTypes: List<ResolvedType>, staticOnly: Boolean, invocationContext: ResolvedReferenceTypeDeclaration): SymbolReference<ResolvedMethodDeclaration>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun solveWith(symbolDeclarator: SymbolDeclarator, name: String): SymbolReference<ResolvedValueDeclaration>
Static methods
Link copied to clipboard
Link copied to clipboard
open fun typePatternExprsDiscoveredInPattern(patternExpr: ComponentPatternExpr): List<TypePatternExpr>
When looking for a variable declaration in a pattern expression, there are 2 cases: 1.
Link copied to clipboard
Link copied to clipboard