Phpstorm stopped recognizing some files. php

Asked

Viewed 616 times

1

After renaming a php file, Phpstorm no longer recognizes this file as a .php. The file is without the colors, does not give suggestions, anyway, it is like a generic file. The image below shows in case the status.php. How do I have it recognized as php? inserir a descrição da imagem aqui

  • Which version of phpstorm is it? see if this file is associated with the php editor, right click, see if you have the option open with

  • It’s version 9.0.2. I set it to be the default to open . php, windows is normal. This is only inside the phpstorm and happened after renaming the aquivo

  • When I said associate editor, I meant inside phpstorm, it has several editors, php, javascript etc. your file seems to be associated with plain text editor ... I don’t have phpstorm here to test but I imagine it works similar to eclipse.

  • I get it, you really don’t have the option open with*

  • 1

    I did an action search Ctrl+Shift+A and searched for File Types and found the file associated with .txt. Thank you @rray and Rodrigo below, as you refer me to discover this.

  • you could post an answer to how you solved the problem, it’s good if you have some screenshots.

  • Post as an answer to my question?

Show 2 more comments

2 answers

2

Use the following command: Crtl + Alt + S then look for File Types (aqruivos types).

Selecting Text option, see if in the table below in Registered Patterns your php file name is not listed.

When I had this problem at the bottom of the list "Exemploarquivophp.php", was do remove and worked.

inserir a descrição da imagem aqui

0

You have renamed the file with the extension .txt. Just select it, go on Refactor > Rename and rename it back with the extension .php.

  • It is . php, even going in Name. The box is Status.php, just like this.

  • Even if I delete the file and create again by saying it’s . php, it comes back this way. It is as if it were written in the ide that all Status.php is not php

  • 1

    I discovered that there is a command called mark as Plain text when you click with the direct button on the file. Tend to click again and select the option mark as PHP.

  • Maybe I clicked there unintentionally, but in the status.php there is no contrary option

  • there is this option in another file?

  • There is a file in the path .idea/misc.xml that Phpstorm manages. In it you will see the file within a list <component name="ProjectPlainTextFileTypeManager">. Try deleting the line corresponding to the file from that list and restart Phpstorm.

  • Only in normal files, like products.php in the image

  • The file does not have the 'Projectplaintextfiletypemanager' node. Very strange

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.