Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ SQL error highlight

I would like the errors related to the DDL or DataSource to be marked as propper errors (underlined in red or whatever). Instead, for instance, what I get when I reference a non existing table is just a yellow highlighting, as if it was a warning.

I'm using IntelliJ IDEA 12.

For instance, this query is correct.

SELECT S.CODE_SERVICE FROM SERVICE S;

But in this query:

SELECT S.CODE_ZZERVIZZE FROM SERVICE S;

the word CODE_ZZERVIZZE will be only highlighted and a kind of a warning message will be displayed when I hover the mouse over:

unable to resolve column 'CODE_ZZERVIZZE' less... (Ctrl+F1)
This inspection performs unresolved SQL references check.

What I would have expected is that the line was marked with a propper error so that I can clearly spot the compilation problem.

like image 283
spakendralo man Avatar asked Mar 22 '23 05:03

spakendralo man


1 Answers

With your cursor on the warning, bring up the quick fix menu (Alt+Enter or ). From the quick fix menu select "Inspection 'Unresolved reference' options" > "Edit inspection profile setting". In the inspection setting dialog, change the severity to the desired level. Clicking the ellipsis button opens an open where you can add custom levels.

Edit:

Just to clarify, that will only change the error level (and thus highlighting and error strip) of the problematic word/variable. There is no way to change it so the whole line is highlighted rather than just the invalid variable if that is what you wanted.

like image 96
Javaru Avatar answered Mar 24 '23 23:03

Javaru