Thinking about this in working on tree-sitter-lint
I believe the way tree-sitter works is that you could have the same capture name in multiple places, and then the query captures API will return you all nodes that match either one of those captures (of the same name), and the capture index I'm guessing would be different depending on which "instance" of that capture name matches but they would both resolve to the same capture name?
That's definitely worth sanity-checking
But if so then I think that implies that our CaptureIndex should in fact store eg a Vec<usize> or whatever which would represent all of the capture indices corresponding to the specified/default capture name?
Thinking about this in working on
tree-sitter-lint
I believe the way
tree-sitter
works is that you could have the same capture name in multiple places, and then the query captures API will return you all nodes that match either one of those captures (of the same name), and the capture index I'm guessing would be different depending on which "instance" of that capture name matches but they would both resolve to the same capture name?That's definitely worth sanity-checking
But if so then I think that implies that our
CaptureIndex
should in fact store eg aVec<usize>
or whatever which would represent all of the capture indices corresponding to the specified/default capture name?