neovim/test/functional/treesitter
Lewis Russell ac2dff64a5 fix(treesitter): make sure injections don't return empty ranges (#24595)
When an injection has not set include children, make sure not to add
the injection if no ranges are determined.

This could happen when there is an injection with a child that has the
same range as itself. e.g. consider this Makefile snippet

```make
foo:
  $(VAR)
```

Line 2 has an injection for bash and a make variable reference. If
include-children isn't set (default), then there is no range on line 2
to inject since the variable reference needs to be excluded.

This caused the language tree to return an empty range, which the parser
now interprets to mean the full buffer. This caused makefiles to have
completely broken highlighting.
2023-08-10 18:08:54 +02:00
..
highlight_spec.lua [Backport release-0.9] fix(treesitter): redraw added/removed injections properly (#23408) 2023-05-06 11:55:51 +02:00
language_spec.lua feat(treesitter)!: deprecate top level indexes to modules (#22761) 2023-03-24 14:43:14 +00:00
node_spec.lua feat(treesitter)!: deprecate top level indexes to modules (#22761) 2023-03-24 14:43:14 +00:00
parser_spec.lua fix(treesitter): make sure injections don't return empty ranges (#24595) 2023-08-10 18:08:54 +02:00
utils_spec.lua fix(treesitter): is_in_node_range (#22582) 2023-03-08 23:45:43 +00:00