No syntax highlighting for one html file

In my project there is an html file which has no syntax highlighting.

I created it initially by mistake as a file with no extension and there was something in the file's context menu like "interpret this file as HTML" or something like this. So I clicked it  and the syntax was highlighted. Then after some time I renamed it (on disk) by adding html extension.Then  in PHPStorm the syntax highlighting and icon was gone for this file.

If I rename this file to description-panel_1.html or even back to description-panel (without extension) then the html syntax highlighting appears and the icon changes back to green html icon. But if I rename it back to description-panel.html the syntax and the icon is gone. I tried to delete and re-create the file, to invalidate the cache and restart PHPStorm but it's still the same. It looks like PHPStorm has this particular filename remembered somewhere and associated with txt format. Any ideas how to deal with it?


Hi there,

Settings/Preferences | Editor | File Types

Check both "HTML Files" as well as "Text Files" and delete offending entries (in first it should be "description-panel" and second should have "description-panel.html")


Thanks, it fixed the issue. (I checked the Text Files before but never scrolled down to the bottom because I thought there are only extensions and not whole filenames.)


This helped me, too. Thanks!


Please sign in to leave a comment.