Open nipunlakshank opened 6 months ago
Hey! It looks like this is indeed a problem. I think that it's because the PHP treesitter parser is kinda weird. The PHP and HTML trees both cover the entire buffer and aren't nested inside each other. When we're looping over the language trees here, we first see PHP and then HTML. This means that the HTML tree will always overwrite the PHP one.
I'm not sure what the best solution would be, we might need to add a special case for PHP in that function (something like "if previous tree PHP and new tree HTML, then don't overwrite"), though that might break the cases if we actually do want to use the HTML commentstring
inside the PHP parts.
Will need to play around with this a little bit since there isn't an obvious solution to this 😕
Minimal reproducible full config
Description
In php files commenting inside a <php ?> tag that is inside an html tag results in adding a html commentstring instead of php commentstring Ex:
Steps to reproduce
Ex:
Expected behavior
Actual behavior
Additional context
No response