0

I do not know what happened with my PHP file in PhpStorm 2019.2.3, but it does not work with it as with php file. I mean lack of context help, code reformat etc...

enter image description here

Which options did I changes and how to restore it?

Actually that is problem with only 1 file, the rest are OK.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
mstdmstd
  • 2,195
  • 17
  • 63
  • 140
  • The file context menu has an option “Mark as Plain Text”, most likely you activated that by accident … In that case, it should show “Mark as PHP” now. – 04FS Jan 14 '20 at 12:17
  • See https://stackoverflow.com/a/22709627/783119 or https://stackoverflow.com/a/56144533/783119 – LazyOne Jan 14 '20 at 12:18
  • @04FS It's a bit different -- if that action was used it should have a bit different icon (extra "X" in the icon corner or something like that) – LazyOne Jan 14 '20 at 12:20
  • @LazyOne well `.php` files should probably not show a circle with a C in it as default icon either … hard to tell how they (mis-)configured their IDE here from just a screenshot that shows only the “problem”. – 04FS Jan 14 '20 at 12:23
  • @04FS Sorry, I was not super clear in my comment. If a "Mark as Plain Text" action was used, the it will have a text file icon (like on screenshot) and small "x" in top left corner (https://www.jetbrains.com/help/phpstorm/excluding-files-from-project.html). Here that extra "x" is not present, so the file is still treated as a Text, but due to a different reason. – LazyOne Jan 14 '20 at 12:35
  • 1
    @04FS regrading "a circle with a C in it" -- it's shown for PHP files that contains a single class and its name matches the file name. You will see different icons for Traits, Interfaces, Abstract Classes and more -- https://www.jetbrains.com/help/phpstorm/symbols.html. If such special condition is not met, then `.php` file will have normal PHP File icon (just like `artisan` file form the screenshot has). – LazyOne Jan 14 '20 at 12:40
  • @LazyOne thanks for the explanation, I didn’t dive into PHPStorm’s icon system that far yet. – 04FS Jan 14 '20 at 12:42

3 Answers3

3

You accidentally marked it as text, please check your Settings | Editor | File Types | Text for the filename.

Eugene Morozov
  • 2,790
  • 1
  • 10
  • 17
1

you marked it as plain text. right click on the file and select mark as php

anseve
  • 26
  • 1
0

You need to install PHP Extension on it and restart your PhpStorm

if already install PHP Extension then check on the right bottom and select PHP instead of Plain Text