HTML syntax highlighting appears to have broken on update.

Note: I looked for a bugs or help sub-forum but all I could find was this big old 'discussions' list. So apologies if this is misplaced.

Afternoon,

I just restarted my PC and went to carry  on coding, but it seems that phpStorm auto-updated itself with an update  that somewhat broke the syntax highlighting. I'm not familiar enough  with the settings panel to figure out what I need to change to get it  back to how it should be, or whether I simply need to revert to the  previous version.

The version I am on is 7.1.3, I do  not know what version I was on before. It has been a while since I  restarted the machine / software.

Here's a screenshot of what it looks like now:

http://i.gyazo.com/d28011e3974f7a0007ee09ed9dc39d07.png

Usually  "<!DOCTYPE" all of the < and > would be blue, and the HTML  comment would be bright pink like the PHP comment you can see at the top  but for some reason it's really struggling to figure out what's going  on.

I've checked the "Editor > Colours & Fonts" settings, where HTML comments are set as pink and HTML tags are set as blue; though as you can see these settings aren't being used.

Any ideas would be greatly appreciated as this will drive me insane. Thanks!

6 comments

Hi there,

1) Please show screenshot of the whole IDE not just part of the file.

2) What is the file name (including extension)

3) Does it look correct using Default color scheme?

4) Although it is possible that your previous version had different colors, please show me screenshots of your " Colours & Fonts" for this "mis-colored" elements (you can copy content of your file into clipboard and insert it into preview area in settings)

0

1) I can assure you it's phpStorm, the only issue I have is the incorrect syntax highlighting of the HTML tags and HTML comments which the screenshot shows.

2) The file I showed was .php, this bug has also affected .html files the same way unfortunately.

3) I just checked the default theme and it is also happening there, the HTML comments are set to be light grey (RGB 128 128 128) in the settings but they are appearing black in the editor, the same colour as the < and > even though the contents of each tag is blue.

4) Sure, I'll do each one separately...

HTML comments - set to pink and italic, as you can see on lines 2-4... it's neither pink nor italic.

HTML tag - set to blue, as you can see with "<!DOCTYPE", "PUBLIC", all the < and all the >... it's not blue.

HTML tag name - set to blue... actually is blue. Just to show you an example of one that is actually working.

Hope that helps, it's surprising how much something this small affects my productivity. Can't read my own code any more lol.

Edit: 17:30 (UK) - heading home from work. Will check phpStorm at home in the hope that it hasn't happened there and will upload screenshots to compare what it should look like, which might help.

0
1) I can assure you it's phpStorm, the only issue I have is the incorrect syntax highlighting of the HTML tags and HTML comments which the screenshot shows.

I wanted to see file icon -- maybe it as different file type .. or another language (not HTML) so that those styles do not have affect there.

HTML tag - set to blue, as you can see with "<!DOCTYPE", "PUBLIC", all the < and all the >... it's not blue.

For that you need to set colors for "HTML Code" style

HTML tag name - set to blue... actually is blue. Just to show you an example of one that is actually working.

That's confusing -- I do not see any difference in behaviour with the above one.

HTML comments - set to pink and italic, as you can see on lines 2-4... it's neither pink nor italic.

Accordingly to screenshot it should be working (color is set; "inherit" option is disabled). At very least it does work here (checked in both v7.1.3 and v8 EAP on Windows 7).

0
1) I can assure you it's phpStorm, the only issue I have is the incorrect syntax highlighting of the HTML tags and HTML comments which the screenshot shows.

I wanted to see file icon -- maybe it as different file type .. or another language (not HTML) so that those styles do not have affect there.


Oh right, well it was a PHP file with the little purple 'php' icon. It also happens with HTML files.

HTML tag - set to blue, as you can see with "<!DOCTYPE", "PUBLIC", all the < and all the >... it's not blue.

For that you need to set colors for "HTML Code" style


Nah that doesn't work. The HTML Code is just for content within tags... however since my update it is changes almost everything to the colour that you set, it kind of goes mental. Here's an example with a deliberately ridiculous colour just to demonstrate lol...

With this example:

Lines 2-4 should be pink (comment colour), not yellow.
"PhpStorm" on lines 7 and 10, and "What is PhpStorm?" on line 12 should be white.

HTML tag name - set to blue... actually is blue. Just to show you an example of one that is actually working.

That's confusing -- I do not see any difference in behaviour with the above one.


Yeah it doesn't appear to be working any more. Ever since I started using PhpStorm this is how these have worked:

"HTML Code" - affects any content within a tag, for example "PhpStorm" on lines 7 and 10 in the previous example.
"Tag" - affects the <, the </ and the > of the HTML tags.
"Tag Name" - affects the tag name, for example "head" "title" etc.

So in order for this to look like it does... <title>My Website</title>...

HTML Code - would have to be light grey.
Tag - would have to be blue.
Tag Name - would have to be blue.

HTML comments - set to pink and italic, as you can see on lines 2-4... it's neither pink nor italic.

Accordingly to screenshot it should be working (color is set; "inherit" option is disabled). At very least it does work here (checked in both v7.1.3 and v8 EAP on Windows 7).


Indeed, according to my settings it should be working. However PhpStorm is either struggling to parse the syntax in every single PHP and HTML file that I open, or a fundamental change has happened to the core syntax highlighting logic that no-one else seems to have noticed / complained about.

I can't figure it out for the life of me.

0

no-one else seems to have noticed / complained about

Possibly -- most likely because others do not have such colorful color scheme where every element has different color.

But in any case -- it seems to be working OK for me here on Windows 7 (this screenshot is from v8 EAP build 138.184 .. but it works in v7.1.3 as well).
screen01.png

So far it seems to be affecting your installation only. Possibly it's your color scheme. Please export your color scheme ("File | Export Settings..."  or manually) and attach here -- I will try it on my computer.

I suggest backup and delete all of your current config files (make full reset of settings) to start from scratch -- see if issue will remain there. If not -- you will be able to recover most (if not all) of the files back from backup. https://intellij-support.jetbrains.com/entries/23358108-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs


P.S.
I strongly advice to try v8 PhpStorm EAP -- see how it works there (settings are stored separately).

0

Interesting.

I exported my colour schemes and as I was about to reply I noticed that everything had fixed itself.

All I did between it being broken and being fixed was:

1) Click - PhpStorm > Preferences
2) Click - Editor > Colours & Fonts > HTML
3) Click - "Scheme name:" dropdown.
4) Deselect - "Scheme name:" dropdown.
5) Click - Save As...
6) Click - Cancel in 'Save As...' dialogue.
7) Close preferences.
8) Click - File > Export Settings
9) Untick everything except 'Colour schemes'
10) Click - OK

Then I noticed it was fixed.

I switched between colour schemes for testing purposes yesterday, so steps 3+4 can't have been what fixed it. Step 5+6 could have done something weird that fixed it, maybe the 'Save As...' button reloads the scheme ready to save it?

Weird, but all fixed up for now. Thank you for your help!

0

Please sign in to leave a comment.