Closed Hippo0o closed 10 months ago
PHP is a templating engine which can be used for any type of text file---the treesitter query injects html because that's the most common, but the node itself is called text
in the grammar which is indicative of this. Additionally, it shouldn't be the html parser's responsibility to analyze .php
files.
I'm asking because i was investigating issues i have using neovim and files that mainly have html with some php code in it.
What issues were you having?
@calebdw i wrote about it here https://github.com/nvim-treesitter/nvim-treesitter/pull/4653#issuecomment-1593091425
The main issue seems to be that the @combined
query will combine the ranges of the whole text node which collides with the ranges of the php nodes inbetween. And because of the ordering or smth the html ranges overshadow all inbetween.
so the problem primarly lies with the neovim treesitter implementation of querying injections
Hmm, I don't see any issues with the Neovim hightlighting?
so the problem primarly lies with the neovim treesitter implementation of querying injections
Sounds like this issue can be closed then
Thanks for giving me an answer.
PHP files are just html with php code blocks in it. So why does this parser work the other way around combining html around the php code blocks to inject html? Would'nt it make more sense if the html parser injected php?
I'm asking because i was investigating issues i have using neovim and files that mainly have html with some php code in it.