Toad World® Forums

Automatic uppercase, brackets and commas


#1

Hello,

I’ve configured the formatter tool to automagically uppercase the keywords, built-ins and built-in packages as you type, but it does not seem to work for the “varchar2” keyword in the code snippet below:

CREATE OR REPLACE
PROCEDURE a
(i IN varchar2, j IN varchar2)

In particular, if a keyword is followed immediately by a (closing) bracket or comma, it will no be uppercased. If it is followed by a space or a semicolon, it will get uppercased. Idem if you select the code and do CTRL-R (force code formatting).


#2

Also with that option I got uppercase even when I am entering a string (after ') like
'Please UPDATE
when editing
when I wanted
'Please update

I think it should not change if we are entering a string (even before we close it)

Filipe


#3

Hi Dominique,

I can repeat only repeat part of the issue as I type in Code Editor:
CREATE PROCEDURE a
(i IN VARCHAR2, j IN varchar2) IS
k VARCHAR2;
BEGIN
SELECT i INTO k FROM udal;
END;

The varchar2 wasn’t uppercased only when followed by a closing bracket.

And formatter performed fine for this. I got:
CREATE PROCEDURE A (I IN VARCHAR2, J IN VARCHAR2)
IS
K VARCHAR2;
BEGIN
SELECT I INTO K FROM UDAL;
END;
/* Formatted on 1/23/2009 11:32:13 AM (QP5 v5.120.811.25008) */

Hi Filipe,

I find SQL Nav acts just like what you want. When entering, I got:
SELECT ‘update’ FROM dual;

UPDATE tb SET col = ‘update’;

After formatting:
SELECT ‘update’ FROM DUAL;

**UPDATE *TB
SET COL = ‘update’;
/
Formatted on 1/23/2009 11:35:54 AM (QP5 v5.120.811.25008) */


#4

Filipe, I think the upercasing algo “triggers” depending on the character typed after each word.

If this character is a space, or semicolon, or… it will trigger, if it is a closing bracket, alphanumeric character,… it won’t.

Just guessing, though.


#5

Vincent,

Maybe it has something to do with some other formatting settings I have.
I’ve attached my FmtOptions.opt file.
FmtOptions.opt (904 Bytes)


#6

Hi Dominique,

Thanks for attaching the options file. I’m taking one week’s leave for Chinese New Year currently. I will come back to you when I’m back to work on Feb 2.

Regarding the closing bracket or some other char that won’t trigger uppercasing when typing, Gwen will look at it next week.

Thanks
Vincent


#7

Vincent,

Enjoy your holiday and have great (Chinese) year-crossing!

(BTW: the issue at hand is not urgent)


#8

Hi guys,

I just want to clarify that the formatter tool has nothing to do with uppercasing keywords when you type. The formatting options are only applied after you format the code (i.e. pressing Ctrl+R).

When you’re typing, the option that controls this behaviour is Preferences>Code Editor > General > Keywords to Uppercase.

I can reproduce both issues raised by Dominique and Filipe and I have raised a CR to fix these. Just like Dominique has pointed out, if you type
'Please update
and then press space, it will not uppercase the keyword as it’s inside quotation marks.
If you press enter, it will. That’s why Vincent could not reproduce it.

Gwen


#9

Just a simple bug notice: (with Preferences->Code Editor-> General-> Keywords to Uppercase ON like before)

when writing code you use space/enter it will upper case the word but if you use the cursor keys it will not.

Filipe

Message was edited by: Fsilva


#10

Gwen,

If a type in a keyword, followed by either a comma or an opening/closing bracket, that keyword does not get uppercased (as I would expect, because “View”->“Preferences”->“Code Editor”->“General”->“Keywords to Uppercase” is enabled).
Not scheduled for 6.2-final, I suppose?


#11

No, I’m afraid not Dominique. We will look into this post 6.2.

Gwen


#12

Hi Huyen (sorry I always use Gwen due to the username)

I this you wanted to say 6.3, no?


#13

Huyen or Gwen is both ok.

Yes, it’s targeted for 6.3.