How to disable highlighting for SQL code in phpstorm?

phpstorm

Solution

SQL Language is automatically injected in strings that contain SQL code (which are detected by the typical patterns, e.g. `select xx from` etc). It also injected in HEREDOC/NOWDOC if you use special label (`SQL`).

You can disable these (selected on the screenshot below) and any other unwanted injection rules or create your own at `Settings/Preferences | Editor | Language Injections`.

P.S. Since you do not need any SQL/DB support at all, you may just disable SQL/database support plugins completely.

If you do like such injections in general but just do not want them in a specific place only (e.g. because of the false positive match) then you can force plain text in that string. For example:

$str = /** @lang Text */ 'Select all entries from my cool database';

Please note that such comment must be placed just before the actual string (so it can be used in function call params or alike), not before the whole variable assignment/statement like ordinary PHPDoc comments.

P.S. The same is possible other way around: force SQL in some string that is not autodetected by Language Injection rules (e.g. when string is split into concatenated bits or uses unknown/unexpected sequence/syntax).

Problem

How to disable highlighting for SQL code in phpstorm ? i ever disabled all sql inspection..but color and fonts rules continue to overight my php string color rules . Here is an Exemple for what i want to achieve : ``` $var_php = " all text here is red , SELECT * and whatever sql code is in red too " ; ```

Original source