Toad World® Forums

new Formatter can lead into very confusing code


#1

Hi,

after all faster then I thought…

The new Formatter needs a urgent review and a correction for SQL-statement alignment.
Especially in stored code (packages) the current only available style is not applicable, since it can lead into very confusing code in case of very long column lists.
Please improve this as soon as possible.
Please see the attachment containing screen shots.

Andre
image001.gif


#2

Andre,

Please have a look in the options “Formatter Options” -> “Statements & Clauses” -> “Other Lists”. I’d set “SELECT/FETCH/RETURNING…INTO” to “Wrapped”.


#3

Hi,
When I do as you wrot, the result is even more strange.
The SELECT is Ok now, but the tabs are just nonprintable char now…
See attachment.
What can I do to avoid this?

Andre
Formatter_issue_20081212.jpeg


#4

Andre,

Maybe “Formatter Options” -> “General” -> “Tabs” -> “Insert spaces” ?


#5

Hi,
No, that is already set to “Insert Tabs”
The strange thing is,
that this did not happen before my first changes to fmt options at all.
Hmm…
Andre

Yep! Seems to be an ugly bug somehow.

When you save such a package after formatting (and the odd style) and open it again it looks good again.
I found that there are packages where this never happens and for others it is so all the time when I use the formatter. All at the same DB and schema.
So far I could not found any systematics to surely reproduce this behavior.

Message was edited by: andreml


#6

Andre,

I’d think the little squares are actually tab-characters.
My suggestion was to enable “Insert spaces” to remove those.


#7

Oh, sorry.
Yes you are absolutely rigth.
And this option makes the issue not happen again.

But what remains is th equestion:
Why does it differ between different packages?
Well, seem that a big big screen is not enough … -:slight_smile:

Andre


#8

Hi Andre,

I couldn’t reproduce your issue but I think it happened to me once or twice. My wild guess is there’s a conflict between the Formatter options and the Code Editor preferences.
Under Code Editor > General, there is an option called Use TAB character. In your case, you may not have this option ticked while having the Insert Tab selected.
Would you please select both options and let me know if you still have the square issue?

Gwen

Message was edited by: Gwen


#9

Hi Gwen,

since after opening such a “problem” package after a (messy) formatting it looks good again,
I would guess it’s just a editor text representation issues.
The tabs are visible as a char but does not indent the text as a “real” tab should do.
However as you can see from the screen shot, the option you asked for, has been set (activated).
I do belief this is an “real” issues that needs attention.

Regards
Andre
Formatter_issue_20081215.jpeg


#10

Hi Andre,

Thanks for your clarification. I will keep an eye out for this issue and hopefully nail it the next time it happens.

Gwen