Funnily enough, IDEs a decade ago (more, even) solved this for PHP already, as even back then a lot of PHP was still HTML and PHP (and JS) intermixed in one file. It’s a shame we haven’t solved it properly in modern editors without having to rebuild the tooling over and over again for every new framework.