Toad World® Forums

Syntax Highlighting


#1

select type from v$session;

declare

my_var v$session.osuser%type;

begin

my_var := ‘NOTHING’;

/

This is not a biggie, but:
************end;
In an anonymous block %type is not colored properly, but outside it is?

Message was edited by: Lozier


#2

Dave,

I think the PL/SQL reserved word “type” is colo(u)red, but “%type” used in an anchored type variable declaration is not…


#3

in 5.5 formatter %ROWTYPE and %TYPE get Highlighted!


#4

True. I will log a CR for this.

Gwen


#5

SQL Nav V 6.0.0.1055

keywords are found and up-cased in comments - but not always.

Only appears to happen if the comment is indented - e.g.
– IN FROM are capital
– in from are lower

common oracle library functions not up-cased and can’t see how to change this. e.g. to_date I’d like in upper case.

I can’t find the syntax highlighting options - in 5.5.4 was in code editors -> general
in 6 I can’t find it.

Anyone got solutions / work-arounds?

S.


#6

In 6.1, Code Editor -> General -> Syntax highlighting is still there.
And it looks the same as in 5.5…


#7

Yep, the option is still there. Please refer to my screenshot.
Gwen
pref_syntaxhighlight.gif


#8

Hi Stuart,

I couldn’t reproduce this. Did you type ‘-- in from’ or did you type ‘in from’ and then add ‘–’ at the beginning?
The whole time, I had option Code Editor > General > Keyword to Uppercase ON.
If I type ‘in from’, both become uppercase
If I type ‘-- in from’, none is in uppercase
If I type ‘in from’ and then add ‘–’, they’re in uppercase.

For Oracle functions, you will have to use the Formatter to do the trick:
Tools > Formatter Tools > Formatting options

Cheers
Gwen


#9

Hi,

Thanks for looking into this for me!
I’ve found the syntax colours as pointed out but still can’t up-case the Oracle Function names automatically.

comments in case:

I have Code Editor -> General -> keywords to uppercase ticked

Just typing - indenting with the tab bar I get: (I used only for “I”) I started with the “–” before entering the ret of the line. I have tab set to be a real tab, not spaces.

– this is very interesting
– I am surprised TO be IN this situation
– I am from a to and in a select
– I am FROM a TO AND IN a SELECT CASE

SELECT * FROM dual

(see attached file for screenshot)

I have V5 and v6 both installed at the same time at present.
keyword_case.png


#10

Hi,

My last post made me think - I’ve experimented and it is related to the setting.

If I remove the “use tab” option then an indented comment does not get converted to upper case.
With “use tab” set - my comments are capitalised again.

Can this be fixed in a future release?

Stuart


#11

Hi Stuart,

I can reproduce the issue this time. The extra information certainly helps identify the root-cause. It will definitely be fixed in the future but I’m not sure if it makes it to the 6.2 list. I will inform you if a decision is made.

About Oracle built-in functions, the option in the Preferences dialog will not work. You will need to format the script using the Formatter tool found under Tools menu.

Thanks
Gwen

Message was edited by: Gwen


#12

Check out this snapshot of the Formatter options.
format_snapshot.gif