Function findLeafNodeAtOffset

  • Finds the leaf CST node at the specified 0-based string offset. Note that the given offset will be within the range of the returned leaf node.

    If the offset does not point to a CST node (but just white space), this method will return undefined.

    Parameters

    • node: CstNode

      The CST node to search through.

    • offset: number

      The specified offset.

    Returns LeafCstNode | undefined

    The CST node at the specified offset.