Closed gzmorell closed 1 year ago
I prefer "(" and ")" stay as anonymous nodes, is there a reason Helix can't match on anonymous nodes?
I first tried with anonymous node, "_paren_argument" instead of "paren_argument", as in this case tests and queries were still valid ones, but matching did not work in Helix. I don't know the reason. AFAIK other tree-sitter grammars has some non-anonymous node starting with parenthesis.
So I think the quotes being anonymous nodes is not the problem, hence I won't merge this PR. I will leave this PR open and please feel free to suggest changes if you found the underlying cause with Helix.
Just to be clear, with non-anonymous nodes, matching parenthesis works in Helix.
yes, I understand that, what I'm suggesting is you should discuss this issue with the Helix maintainers, and if they say that the problem is with the parentheses being anonymous nodes, then I will consider changing them to non-anonymous nodes.
I have been looking at Helix source. They use this function to iterate the nodes:
let mut node = tree.root_node().named_descendant_for_byte_range(pos, pos)?;
No idea why they use the named version.
an oversight, maybe?
I have tested with anonymous nodes and changing named_descendant with descendant, still not work. Furthermore, testing the grammar for anonymous nodes, seems not to be easy. "tree-sitter parse" only prints named nodes.
neovim has a feature for it and it's quite easy to set up for debugging if you need
@gzmorell is this needed anymore? can you close it?
Adds a node with parenthesis. This is needed in helix-editor to allow match parenthesis to work.