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 " ;
By default, PhpStorm highlights all detected code problems. Hover the mouse over the widget in top-right corner of the editor and select another level from the Highlight list: None: turn highlighting off. Syntax: highlight syntax problems only. All Problems: (default) highlight syntax problems and problems found by inspections.
To re-enable a suppressed inspection, delete the /** @noinspection */ annotation. By default, PhpStorm highlights all detected code problems. Hover the mouse over the widget in top-right corner of the editor and select another level from the Highlight list: None: turn highlighting off.
The Generic SQL dialect supports completion and highlighting for SQL keywords, table and column names. Syntax error highlighting is disabled, that is all statements in a query console are shown as syntactically correct).
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With