Single PHTML file not shown as php

I have a single .phtml file that is no longer shown or editable as a PHP file.

I believe this was triggered by an accidental keyboard shortcut combo when I thought I was typing on my windows machine, but I have no idea what the shortcut was or how to reverse it.

The file was fine, then suddenly it had an icon like a text file with an X on it... and no longer had formatting, colours, etc. of a php file:

All of the support answers I have found related to this say to go to Settings > File Types... but everything is fine there, somehow only this one file is affected.

What can I do to reset this file to be recognized as a php file?

Thanks!

4 comments

I suppose you mean 2018.2.2 (released in August) but this setting hasn't changed in years as far as I know.

And, sorry, you are absolutely right. The "Mark as Plain Text" command doesn't seem to get reflected in "Editor > File Types". Instead, you get the context menu replaced with "Mark as PHP":

Here's the corresponding help topic.

1

Please open program settings and review Editor/ File Types. You probably asigned that file name as registered pattern for Text.

 

0

I tried that, my editor looks different, I go to File > Settings > File Types... but that does not show individual files.

I do not see the Mark as Plain Text option you show in your screenshot and do not know how to lookup the settings for an individual file.

I am using PHPStorm 2018 v2.2.2.

0

That answered my question, thank you. As a tip for others, at first I was right clicking on name of the tabbed file open in PHP Storm and that did not bring up the context message in the screenshot above and when that didn't work I went to file>settings which also didn't work.

To get the context menu shown above I had to right click on the file in the project file list - then it was easy to restore.

Thanks!

 

0

Please sign in to leave a comment.