No syntax colouring on SQL language injection

I just switched from Mac to Linux and am getting my PHPStorm (5.0.4) set up. I exported/imported my settings and most things seem to have gone well... apart from MySQL code colouring. I have configured my data source and checked the following settings, I think it covers everything from the help page on language injections:

* Settings > Editor > Colors & Fonts > SQL - the preview there shows correctly
* Settings > Language Injections - All are ticked and the both PHP/SQL ones set to SQL (I tried also changing them to MySQL)
* Settings > SQL Dialects - the project is set to MySQL
* Settings > Intentions > Language injections - all ticked
* Settings > Plugins > IntelliLang - enabled

Weirdly, where I have MySQL fragments in string literals, PHPStorm does seem to recognise them as language injections - autocomplete of table and column names works as expected, and right-clicking enables me to generate a DB diagram. But the code is not coloured as it was on my Mac install.

Any ideas of what I'm missing? As far as I can tell, the only difference is the platform itself.

5 comments
Comment actions Permalink

Hi Matthew,

Do you have colors if you create standalone SQL file (e.g. testdb.sql) ?

0
Comment actions Permalink

Thanks for the reply - I tried that and it worked as expected. I then realised that it wasn't just the SQL colouring; various other PHP syntax checks were not happening, and it led to a long series of experiments of enabling/disabling various inspections, excluding/including files and folders, and I eventually discovered that certain files were causing PHP inspections to fail for the entire project.

The simplest manifestation is that going to Code > Inspect code just fails if PHP inspections are on; it might start, but then dies (the progress bar disappears) without showing the results. I tried to narrow it down to certain files or elements in code but I couldn't find anything odd - or common - in the many files which seemed to cause it.

* I got the same result using OpenJDK or Sun Java
* Exactly the same code runs all inspections fine in 5.0.4 on Mac OS
* Exactly the same code runs all inspections fine in v4 and v6 on Linux

So it seems to be specific to v5 on Linux. I'm using v6 for now, but would rather be using a stable version; does anyone have a download link to 5.0.3 or 5.0.2 that I can try?

0
Comment actions Permalink

Hi Matthew,

I'm using v6 for now, but would rather be using a stable version

Current v6 EAP builds are pretty stable (at least for what I'm doing -- have not met any crash yet or inappropriate behaviour that would be worse than in v5).

does anyone have a download link to 5.0.3 or 5.0.2 that I can try?

Try downloading 5.0.4, grab the URL and then just replace numbers to 5.0.3 or whatever. Unlikely to work (as old versions got deleted once new stable build is available) but worth trying.


Maybe it is conflicting with something inside IDE?

  • Have you tried brand new installation (backup and delete ~/.WebIde50 -- "config" folder can be backed up, "system" can be just deleted -- it contains indexes/caches and similar stuff)?
  • Try disabling all unnecessary plugins, leaving only the most important for PHP ones (e.g. disable VCS, Command Line, Remote Host etc)
0
Comment actions Permalink

Hi Andriy

Many thanks for your helpful reply - much appreciated!

Have you tried brand new installation (backup and delete ~/.WebIde50 -- "config" folder can be backed up, "system" can be just deleted -- it contains indexes/caches and similar stuff)?

Aha... before trying plugins as you suggested, I just deleted ~/.WebIde50/system - seemed to do the trick, everything seems to be working as expected! As you suggest, I guess something got confused in there. So I am back in business - again, huge thanks for your help. (Phew - one moving-to-linux issue resolved... onto the next!)

0
Comment actions Permalink

Hi Matthew,

Aha... before trying plugins as you suggested, I just deleted ~/.WebIde50/system - seemed to do the trick, everything seems to be working as expected!

Next time please try "File | Invalidate caches..." before deleting such folder (that is if you have not tried it yet while trying to resolve this issue) -- usually helps with quirks that happening after bad shutdown/crash or after minor upgrade (e.g. 5.0.3 -> 5.0.4).

0

Please sign in to leave a comment.