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