I have a problem similar to:
Wrong syntax highlighting for PHP file in PHPStorm
IIRC, I created a file under the wrong name (IndexViewphtml
, no extension), then renamed it to IndexView.phtml
. Since then, it is recognized as plain text:
As advised in the linked question, I went to Settings|Editor|File Types
and ensured that this file name was not assigned to Text
files:
I also checked that the file was not currently marked as plain text:
As a last resort, I:
- deleted the
.phtml
file and its parent folder - closed PhpStorm
rm -rf .idea
rm -rf ~/.cache/JetBrains/PhpStorm*
And to my surprise, when I re-launch PhpStorm and recreate the folder + file, it is still recognized as plain text!
If I rename it to, say Index2.phtml
, the file is correctly recognized as PHP.
What did I miss? I'm using the latest 2020.3 EAP.