Syntax highlighting - UPPERCASE custom keywords?

Stew Stryker

Member³
Sorry, this feels like a really dumb question!

When I add custom keywords, I'd like to be able to define some that are uppercased. I have UPPERCASE keywords set in Prefs and have added some custom keywords (e.g. DBMS_OUTPUT.PUT_LINE).

Why doesn't this get uppercased when I use the Beautifier? I also have the Syntax Highlighting plugin, if that matters.

I even tried editing the Beautifier settings and adding it to the Special Case set (one per line, in the case I want). No help?

My only other thought is to manually edit the PLSQL.kwf file to add my favorites, but that feels clumsy, harder to maintain and slightly dangerous. :eek:

Thanks,
 
The dot is probably causing the problem. If you add DBMS_OUTPUT.PUT_LINE to the Special Case section, nothing will happen because the beautifier treats this as 2 separate words. If you add DBMS_OUTPUT and PUT_LINE (indeed one per line), it works okay.
 
While we're on the subject, I've been keeping a list of Oracle keywords that are not recognised by PL/SQL Developer as of 6.04. Any chance of adding these to the .kwf files in the next release?

CORR
COVAR_POP
COVAR_SAMP
CUME_DIST
DECODE
DENSE_RANK
FIRST_VALUE
GROUP_ID
GROUPING_ID
LAST_VALUE
LEAD
LENGTH
LOWER
NTILE
NVL
NVL2
NULLIF
OVER
PERCENT_RANK
PERCENTILE_CONT
PERCENTILE_DISC
RANK
RATIO_TO_REPORT
ROW_NUMBER
RTRIM
STDDEV_POP
STDDEV_SAMP
SUBSTR
SYS_CONTEXT
TO_CHAR
TO_NUMBER
TO_DATE
TO_CLOB
UPPER
VAR_POP
VAR_SAMP

Spurious keywords (highlighted but don't seem to be keywords):
LABEL
NAME -- Part of ALTER SESSION syntax
SECTION
SWITCH -- Part of ALTER SYSTEM SWITCH LOGFILE
SYS
UPPERCASE

I find you can place phrases such as SWITCH LOGFILE and NULLS FIRST in sql.kwf, which can prevent some unwanted suggestions and highlighting effects.
 
Note that most of these words are SQL functions, which are not considered language keywords. We could make an option for this of course.
 
Wow, must say it never occurred to me (or I would guess most database developers) that DECODE, NVL etc were not technically keywords and should therefore not be highlighted.

I notice that sql.kwf does contain

AVG
CASE
CAST
COUNT
CUBE
MIN
MOD
TRIM

but also a lot of specifically PL/SQL keywords such as

BINARY_INTEGER
BOOLEAN
IF
FORALL
PRAGMA
SQLCODE
SQLERRM

I would have expected those to be taken care of in plsql.kwf. Not that that's my problem of course, I'm just wondering what the logic is.

At least it's not as bad as the default Vim syntax highlighting, where SELECT, AND and NOT come up in one colour, and FROM and WHERE in another. (I am REALLY going to have to figure out how to fix that one day).
 
plsql.kwf contains all keywords you can find in the PL/SQL Reference Guide.

sql.kwf contains all keywords you can find in the SQL Reference Guide, plus all keywords from plsql.kwf.

command.kwf contains all supported SQL*Plus command syntax elements, plus all keywords from sql.kwf.
 
Back
Top