21

is it possible to turn off background highlighting for SQL strings in PHP Storm ? I know I can turn off SQL language injection, but i would rather keep SQL syntax highlighting and just get rid of irritating background colors. Is it possible ?

4 Answers 4

37

Go to File -> Settings and then to Editor -> Colors & Fonts -> General. Click 'Injected language fragment' and simply untick the Background checkbox.

Screenshot of settings window

Sign up to request clarification or add additional context in comments.

3 Comments

It didn't worked, but helped to found whats going on. Actually SQL's doesn't have any kind of background, it came out I have warning on those SQLs (found out it when I unchecked background for "warning" element on the same list) - and because of those warnings SQLs were highlighted.
This worked perfectly. Glad I found this solution rather than making a copy of Darcula and then only removing that specific SQL background (external commands).
Turn off background for warnings worked for me too. Phpstorm stucks at sql inspections
7

2 possible colors :

  • #52503A (gold/dark yellow) : color code for "Warning" because no Database is set. Go to View/Tool Windows/Database. Then click the "+" button to add a database and click many buttons up to the end.
  • #364135 (khaki/green) : color code for "Injected language fragment". Go to Settings/Editor/Colors & Fonts/General/Injected language fragment and change background color.
    For instance you can set a slightly darker color from the original background for PHP. For Darcula theme base, I used #1A1C1C as a darker color.

There may be more cases but these are the two I encoutered.

Comments

4

In my case it was Editor > Inspections > SQL > No data sources configured. To find out what PhpStorm is warning about, you can click on the highlighted area and then on the hovering lightbulb to get the tooltip.

Comments

3

when sql dialect is not configured, sql strings glow in a annoying yellow. You have to set sql dialect for the file or project.

Go to File/Settings/Languages & Frameworks/SQL Dialects and then select your desired dialect. If you choose the root folder, you will be asked if you want to apply it to all files.

After that you can set the color for injected language fragment as explained by @chocochaos

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.