Custom Syntax Highlighting in SQL Developer
A few years ago I raised an enhancement request for SQL Developer to add custom highlighting, specifically to “grey out” all the calls to logger throughout my code. I blogged about this here.
Oracle SQL Developer 18.3 adds this feature with PL/SQL Custom Syntax Rules – and the best thing is, these rules are enabled by default so you don’t have to do anything. Any calls to logger, dbms_output and apex_debug will be greyed out.
You can customise the colour for this rule in Tools -> Preferences -> Code Editor -> PL/SQL Syntax Colors – the one for logger etc. is called “PlSqlCustom2”:
You can view (and edit, if you want) the rule in PL/SQL Custom Syntax Rules:
I’m not very familiar with the syntax but you can add additional libraries by adding more lines like this to the rule:
| ?grandChild = 'MYCUSTOMLOGGER'
The only thing missing is that it doesn’t pick up the standard logger variable declarations (scope and params). I haven’t worked out how to include these in the rule yet.
parthiban
11 October 2018 - 12:41 pm
Its nice option, its easy to track the code for developers.. thanks for your tweet…
vadim tropashko
19 October 2018 - 6:32 am
Here is another useful coloring:
PlSqlCustom1:
[node) c_alias — Search all the nodes in the parse tree
— which are column aliases
| [node) identifier — Or nodes with identifier payload,
& [node-1) query_table_expression — which younger siblings
–are labeled with table names
->
Highlighting undefined identifiers is described there:
https://vadimtropashko.wordpress.com/2018/10/10/custom-syntax-coloring/
Jeffrey Kemp
19 October 2018 - 8:38 am
Thanks vadim, that’s excellent!