In Neovim the parent node is selected when cursor is on first character of a child node
I am using this parser for haskell files in neovim, and want to select the node under the cursor. I've noticed that when the cursor is on the first character of a node, the parent node is currently selected in the `InspectTree` window. This seems like a bug to me, but I'm not sure if its a bug in this parser or in the way that neovim is using it.
Examples :
Parent 'haskell' node selected while cursor on import statement
<img width="1175" alt="Image" src="https://github.com/user-attachments/assets/f268bb77-9322-4fff-a9f1-1b989f1c66ac" />
<img width="1168" alt="Image" src="https://github.com/user-attachments/assets/4b512bbc-6106-40d8-9b5e-e360394a0f52" />
Parent `do` block is selected while the cursor is on the `tidal` binding
<img width="1172" alt="Image" src="https://github.com/user-attachments/assets/09c56ac2-7835-4b0e-956c-6c0d097d89cc" />
<img width="1173" alt="Image" src="https://github.com/user-attachments/assets/6c88832a-1b2a-4508-841e-ea5379cfbba6" />
If I call `vim.treesitter.get_captures_at_cursor()` while the cursor is on the first character of `tidal`, it correctly returns `{ "variable" }`
Can anyone help me understand why this is?
1 条评论