Open roblourens opened 3 years ago
@roblourens php is injected into html, so each php block has no context of one before.
We could add closing bracket in global context (in html.cson) and this will fix this exact problem.
Other issue #246 is about how injection are (not)working, and probably not worth trying to fix. If you're doing more than if/else in html files you probably need template engine anyway (or smth client-side like react).
I think #246 was fixed, and it was the opposite problem that the html in between was not colored correctly. Just mentioning it as generally related.
<?php
will be broken, since context is forgotten in 2nd block. Proper fix would allow html injections inside php injections. However with TM, then there would be the same problems as with sql. This is a bit sad tbh.
This sort of thing has been covered before like in https://github.com/atom/language-php/issues/246, and I don't know whether this can be improved, I think there is a tradeoff between preserving PHP scope info between blocks and having correct colorization in between them. So close this if it's not practical.
Originally https://github.com/microsoft/vscode/issues/74382
Copy and paste the code below. The brackets are with the wrong color
As you can see it provides us just a generic source.php
meta.embedded.line.phpthat
we can't target. This is sort of bug because the second curly bracket (the opening one) have a different scope.