[F] getNodeAtPosition
getNodeAtPosition(script, position, filter)
Resolve the node in the syntax tree that that is at the given position.
Parameters
Parameter | Type | Description |
---|---|---|
script | TypeSpecScriptNode | TypeSpec Script node |
position | number | Position |
filter ? | (node ) => boolean | Filter if wanting to return a parent containing node early. |
Returns
Node
| undefined
getNodeAtPosition(script, position, filter)
Type Parameters
Type Parameter |
---|
T extends Node |
Parameters
Parameter | Type |
---|---|
script | TypeSpecScriptNode |
position | number |
filter | (node ) => node is T |
Returns
T
| undefined