The files in question are .php and not unusually they mostly consist of html and javascript with a little bit of php at the top. I've noticed that PHPStorm doesn't highlight javascript syntax errors in php files. If I put the exact same code in a .html file it highlights errors as it should. I've tried setting the php files in question as HTML in settings > template data language but it doesn't help. I could set all the pages to have .html exts (as this the only thing that works) but then I lose my php formatting and syntax checking. I'm using PHPStorm 8.0.2. This seems like a bug. How do I fix this?
Save the file as .php and then specify JavaScript as a secondary language by going to Settings >> Template Data Languages
Syntax highlighting of PHP inside JavaScript (and other languages)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With