Toad World® Forums

The new code completion [2 Attachments]


#1

[ Attachment(s) from =?ISO-8859-1?Q?S=2E_Ercan_Y=FCzbasioglu?= included below]

Hi all,

I’ve just downloaded 5.0.0.133 and tried the extended code completion for
the first time. I must confess I am very impressed with it.

Once you have a new toy, you just want for more, so that’s what I will do :slight_smile:
I have a couple of ideas that would speed up my code writing quite a lot. When I
write a query like:

SELECT *
FROM AdventureWorks. Person.Address
WHERE City =

Code completion lists the columns again, as I did after typing WHERE. However,
it is most likely that I want to select a particular city. Wouldn’t it be
nice that City gets listed as pre-expanded and cursor goes to the first value of
City? Please see the attached image shot1.jpg .

When joining, on the other hand, I probably want to match the column with a
column of the joined table. I already saw that the foreign key relations are
automatically extracted and the joinable tables get listed after typing JOIN.
But not all databases are so nicely normalized and structured as AdventureWorks
is: an OLAP database for example. So similar to WHERE, the dropdown box may just
scroll down to the first column of the joined table after typing ON. See
shot2.jpg for an illustration.

Another idea: In adventure works, if I select City in the dropdown box with
ctrl+space, expand City with ctrl+right and select N"Seattle"
and N"Duluth" with ctrl+space, the resulting code is:

SELECT *
FROM AdventureWorks. Person.Address
WHERE City = ? AND N’Seattle’ = ? AND N’Duluth’ = ?

Wouldn’t it make sense if such a code would be generated:

SELECT *
FROM AdventureWorks. Person.Address
WHERE City IN (N’Seattle’ , N’Duluth’)

That seems a lot more natural to me. It’s not really a good coding practice
to type the literal value first anyway…

And also: I noticed that

WHERE City IN (

doesn’t fire code completion. You must hit space once. I think “(”
should be enough for the dropdown box to appear, shouldn’t it?

Those are my humble opinions after the first 10 mins of playing with the new
code completion.

Cheers
Ercan


#2

Hi again,

I’d like to make some more comments:

  • Wouldn’t it be nicer if code completion menu font were not courier? I was
    pretty happy with the font in 4.6, because it helps distinguishing the menu from
    my own code in the editor.

  • Wouldn’t it be nice if the highlight color in the drop down menu were not
    “light gray among the blacks”, but “black among the light
    grays” instead? Because it is currently not really visible.

  • Ctrl+right/left is now assigned to expand trees when the drop down menu is
    open. Is it possible to change it from the environment options? I want to change
    it to Alt+right/left because I want to be able to go to the previous/next
    word to close the menu.

Cheers
Ercan

On Wed, Mar 3, 2010 at 5:55 PM, S. Ercan Yüzbasioglu
gmail.com > wrote:

[ Attachment(s) from =?ISO-8859-1? Q?S=2E_Ercan_ Y=FCzbasioglu? = included
below]

Hi all,

I've just downloaded 5.0.0.133 and tried the extended code completion
for the first time. I must confess I am very impressed with it.

Once you have a new toy, you just want for more, so that's what I will
do :) I have a couple of ideas that would speed up my code writing quite a
lot. When I write a query like:

SELECT *
FROM AdventureWorks. Person.Address
WHERE City =

Code completion lists the columns again, as I did after typing WHERE.
However, it is most likely that I want to select a particular city.
Wouldn't it be nice that City gets listed as pre-expanded and cursor
goes to the first value of City? Please see the attached image shot1.jpg .

When joining, on the other hand, I probably want to match the column with a
column of the joined table. I already saw that the foreign key relations are
automatically extracted and the joinable tables get listed after typing
JOIN. But not all databases are so nicely normalized and structured as
AdventureWorks is: an OLAP database for example. So similar to WHERE, the
dropdown box may just scroll down to the first column of the joined table
after typing ON. See shot2.jpg for an illustration.

Another idea: In adventure works, if I select City in the dropdown box with
ctrl+space, expand City with ctrl+right and select
N"Seattle" and N"Duluth" with ctrl+space, the
resulting code is:

SELECT *
FROM AdventureWorks. Person.Address
WHERE City = ? AND N'Seattle' = ? AND N'Duluth' = ?

Wouldn't it make sense if such a code would be generated:

SELECT *
FROM AdventureWorks. Person.Address
WHERE City IN (N'Seattle' , N'Duluth')

That seems a lot more natural to me. It's not really a good coding
practice to type the literal value first anyway...

And also: I noticed that

WHERE City IN (

doesn't fire code completion. You must hit space once. I think
"(" should be enough for the dropdown box to appear, shouldn't
it?

Those are my humble opinions after the first 10 mins of playing with the new
code completion.

Cheers
Ercan


#3

S. Ercan, I concur on this request !!! The courier font is functional but
lacks style and looks bland and TTY mode, which is not good.

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image001.gif


#4

You are both in fact wrong :). Just joking though. There is a good reason for
why we use courier and that is when you write SQL and it will replace some part
of what you have written we kind of have to have the same font as the editor
otherwise it will look very confusing. Look at this screenshot below for
instance:

By using the same font in both the drop down and the editor it is very easy to
see where it lines up and what will be replaced. If we didn’t have the same font
you would have real problem seeing where the replace would occur and what would
be replaced.

/Mauritz
image001.gif


#5

You are both in fact wrong :). Just joking though. There is a good reason for
why we use courier and that is when you write SQL and it will replace some part
of what you have written we kind of have to have the same font as the editor
otherwise it will look very confusing. Look at this screenshot below for
instance:

By using the same font in both the drop down and the editor it is very easy to
see where it lines up and what will be replaced. If we didn’t have the same font
you would have real problem seeing where the replace would occur and what would
be replaced.

/Mauritz
image002.png