I noticed that if I'm editing a page with just HTML, but save the page as .php (there is no PHP in the page), there are no code hint colors. If I resave to .html, there are. Might there be a way to show the colors?
See below..
with PHP extension:
with HTML extension:
It's a bug introduced in recent 9.0.1 version.
The idea was to treat double extensions in file name and setup outer language automatically. What this means: in ordinary .php
file all text outside PHP tags is treated as HTML/Plain Text .. but in files like file.js.php
the outer language (text outside PHP tags) is most likely will be JavaScript instead of HTML. To have it as JavaScript (syntax highlighting and code completion/analysis) you would need to manually set it up to JavaScript on per file/directory basis.
So devs decided (after many votes in corresponding ticket) to automate this task. Unfortunately they did not checked well enough how it will work with other double extensions (.inc.php
or .tpl.php
in particular) hence the current behaviour/bug.
This behaviour is already fixed and 9.0.2 should arrive soon (few days). In meantime you can fix it manually in few different ways:
You can just rename the file to get rid of such double extension, e.g. make it just header.php
or inc.header.php
.
Or manually set outer language as HTML in Settings (Preferences on Mac) | Editor | Template Data Languages
-- find your file there and set HTML
in second column.
UPDATE: (18/08/2015)
PhpStorm v9.0.2 has now been released.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With