Open vigoux opened 4 years ago
The first issue seems to be an issue with the grammar. The string is getting greedy. I'll fix that in the grammar. I'll check what matches we are getting back for the comment query. Also, the immediate child operator isn't supported yet by the grammar (but treesitter should still accept it). I'll have something for that soon.
@vigoux After researching the second issue, it seems to be a problem with iter_prepared_matches
in nvim-treesitter. It only gives us the first node. I will submit a PR to fix it.
EDIT: Actually I think this is a problem in nvim core. The treesitter api only gives us one matched node.
Oh, nice catch then, was worth looking into.
@vigoux The second one seems to be in the tree sitter api in nvim. It only gives us one node of the match.
That's interesting Raise the issue in nvim, so that we continue the discussion there, will work on this later.
@vigoux I'll fix the first issue. I want to get a simple reproduction before I submit an issue in nvim.
https://github.com/nvim-treesitter/tree-sitter-query/pull/2 Fixes the string issue.
Hey, I was playing a bit with the playground, it is really nice !
Though I encountered issues with the following query :
@id
does not do anything.@doc
only highlights the very last comment before a function, while it should highlight the group of comments before the function.By the way, the first match does not seem to be parsed correctly.