(node: Parser.SyntaxNode)
| 754 | |
| 755 | // Helper function to get a node's position. |
| 756 | function getNodePosition(node: Parser.SyntaxNode): Position | null { |
| 757 | if (!node) return null; |
| 758 | |
| 759 | // Tree-sitter nodes have startPosition property that contains row and column. |
| 760 | return { |
| 761 | line: node.startPosition.row, |
| 762 | character: node.startPosition.column, |
| 763 | }; |
| 764 | } |
| 765 | |
| 766 | /* OTHER HELPER FUNCTIONS */ |
| 767 |