Wrong syntax highlighting for PHP file in PHPStorm
I don't know what happened but syntax highlighting for one php file stopped to working and also icon next to the file has changed. It shows it's text file instead of PHP .
How can I fix that ?
Solution 1:
Go to Settings|File types and ensure that this particular file name is NOT assigned to non-PHP file type, i.e. Plain Text.
Solution 2:
In PHPStorm 10 you have to go to File->Settings and once there Editor->File Type. If plain text probably you will find it on the file type "Text". Check under "registeded patterns" and delete your file from there.
Solution 3:
Thanks to @Scotty Waggoner
For some reason the entire filename was added to the Text file type.
Find your file in Settings|FileTypes|Text|RegisteredPatterns and remove it.
Solution 4:
I'm not sure if this function is restricted only to phpStorm 9, but there's a simpler solution: if the extension of a file is .php, you can right click on the file in project browsing menu and click "mark as php". That fixed the problem for me.