Use tree-sitter to extract the context near the cursor
A first iteration for #237 (closed).
Algorithm:
- Find the coordinate point of the cursor (row,col). The cursor is always at the end of the prefix.
- Traverse the tree and collect only nodes that have their end point equal to the cursor's point.
- Traverse the list of collected nodes in reverse (going up the tree) and choose the most relevant node type. The most relevant node type is language-specific
Edited by Bruno Cardoso