Change color of PHP variables inside embedded SQL

Hi,

When I use a PHP variable inside SQL code, it is correctly detected (I can ctrl+click on it for instance) but the variable is not highlighted in another color. Is there a way to change its color?
I tried to change the color of variables in Settings > Colors and Fonts > SQL but it has no effect on embedded SQL (see pictures).



Attachment(s):
pic2.png
pic1.png
4 comments
Comment actions Permalink

It's because SQL injection doesn't properly recognize PHP variables. It used to work, then it broke and it's been broken for a long, long time.

http://youtrack.jetbrains.com/issue/WI-534


Related:
http://youtrack.jetbrains.com/issue/WI-2377
http://youtrack.jetbrains.com/issue/WI-2450

0
Comment actions Permalink

Thank you for your answer.
As far as I can read in this thread, this bug will never be corrected. That's too bad because it must be very easy to correct: the variables are recognized by the parser (you can ctrl+click on it). They are just not highlighted with the right color.

0
Comment actions Permalink

I agree. Did you vote for it?

0
Comment actions Permalink

This is an old bug. Been around since 2010. Besides the coloring, auto completion/suggestions is also broken. In fact, in any string.. PHPStorm will not suggest vars.

http://youtrack.jetbrains.com/issue/WI-2377 - is supposed to be fix in version 5. And it's listed as major. So we'll see. By the way, this is nothing special... every other IDE (and most text editors) I know of do this. Don't know why it's not already fixed.

PS. Actually I think I know why. I bet the devs think most are using an ORM or a framework that doesn't require writing sql. But I use a heavly modified version of ezSQL and our own framework - where we write our sql statements. We also use the PDO, where we also write our statements. The lack of this functionality really hurts with INSERTS and UPDATES. it's the only reason I STILL have a copy of Netbeans on my machine.

0

Please sign in to leave a comment.