Closed m-demare closed 2 years ago
This has to do with Neovim’s language injection system. The editor needs to parse the token tree again, to highlight its contents. So there are two trees that cover that part of the document.
I see. Is there a reason why one of the trees sees the field_identifier
as an identifier
though?
Yeah, when initially parsing the token tree, everything is just a token, so it can’t be distinguished as a field.
Okay, thanks for answering!
It can be reproduced with the following code:
Using nvim-treesitter, I get sthe following AST:
As you can see, the range [12, 27] - [12, 30] is both a
field_identifier
and anidentifier
, which isn't allowing me to query reliably only for identifiers, but not field_identifiers. This only happens with macros as far as I know, as you can see it doesn't seem to happen with function calls or constructors Is this fixable?