Toad World® Forums

Format issues in 6.1beta


#1

Hi

I can’t make the new formatter to act as it was with old version:
the way it was:
PACKAGE BODY my_pack IS
PROCEDURE procedure_name(
param1 IN VARCHAR2
, param2 IN VARCHAR2) IS
BEGIN
NULL;
END;
END my_pack;

the new way:
PACKAGE BODY my_pack IS
PROCEDURE procedure_name(param1 IN varchar2, param2 IN varchar2) IS
BEGIN
NULL;
END;
END my_pack;

Do I miss something?

btw. These “stacked”, “table”, “wrapped”, etc list arrangements need more visual descriptions.

Marko


#2

Hi Marko,

If you are using the new Formatter included in the latest beta build, some of the options are not working due to a change to optimize the formatter. Fortunately, this issue has been addressed in our internal build. Please check again in our next beta build and let us know if the problem still persists.

About your suggestion to include more visual descriptions, I will forward it to the Formatter team.

Cheers
Gwen


#3

Hi, I’m Andre, parser and formatter lead at Quest. Yes Marko use the latest beta, that’s a must.

I could approach the old formatter layout very close: parameter declarations stacked on more than 1, dynamic alignment, commas leading with space, IS/AS on the same line … but no perfect match for the parentheses. In fact there seems to be missing an option for this layout:

my_proc (
par1, par2,
par3 )

Look at the current and design panes attached here, the yellow area is this new option, here we feel that it should be numbered 4 (and the old 4 and 5 shifted to 5 and 6) because now 4/5/6 are counterparts of 1/2/3.

Would this help?

Thanks,
Andre
paren_positioning_new.gif


#4

Hi, I’m Andre, parser and formatter lead at Quest. Yes Marko use the latest beta, that’s a must.

I could approach the old formatter layout very close: parameter declarations stacked on more than 1, dynamic alignment, commas leading with space, IS/AS on the same line … but no perfect match for the parentheses. In fact there seems to be missing an option for this layout:

my_proc (
par1, par2,
par3 )

Look at the current and design panes attached here, the yellow area is this new option, here we feel that it should be numbered 4 (and the old 4 and 5 shifted to 5 and 6) because now 4/5/6 are counterparts of 1/2/3.

Would this help?

Thanks,
Andre
paren_positioning.gif


#5

Hi

It would help. (Earlier there was two checkboxes:“In stacked list, the open parenthesis is one the first item’s line”+“In stacked list, the closing parenthesis is on the last items’s line”). Bigger problem was that “stacked” didn’t work at all in first beta.

Now I ran into next issues…
old:
PROCEDURE my_proc(
param1 IN VARCHAR2
, param2 IN VARCHAR2
, param3 OUT VARCHAR2
, result_code IN OUT NUMBER) IS
BEGIN
IF NOT my_boolean_function(param1
, param2
, constant_package1.constant1
, constant_package1.constant2) THEN
result_code := 1234;
RETURN;
END IF;

INSERT INTO my_table
(field1, field2, reg_date, reg_time)
VALUES (param1, param2, TRUNC(SYSDATE), TO_CHAR(SYSDATE, ‘HH24:MI:SS’));
result_code := 0;
END my_proc;

new:

PROCEDURE my_proc(
param1 IN VARCHAR2
, param2 IN VARCHAR2
, param3 OUT VARCHAR2
, result_code IN OUT NUMBER
) IS
BEGIN
IF NOT my_boolean_function(
param1
, param2
, constant_package1.constant1
, constant_package1.constant2
) THEN
result_code := 1234;
RETURN;
END IF;

INSERT INTO my_table(
field1, field2, reg_date, reg_time
)
VALUES (
param1, param2, TRUNC(SYSDATE), TO_CHAR(SYSDATE, ‘HH24:MI:SS’)
);
result_code := 0;
END my_proc;

First minor thing what we can overcome with playing with “diff” options is
the “OUT” placement. (Parameter Declarations>Stacking Aligment>Dynamic in old Formatter). If parameter is IN OUT then no problem. Indenting of parameters of the function also differs.

Second issue is that when both those checkboxes of “In stacked…” mentioned above are checked AND having “compact parenthesis” then insert statments use … compact.

Marko


#6

btw. In old settings: Lists and Operators> Parameters>Style=“Stacked”

  • Minimum number of parameters required to stack = 4

#7

Hi Marcosta,

Thanks a lot for your feedback and sorry for getting back to you late.
I am Vincent and I work on updating Formatter for SQL Nav.

  1. IN OUT - In the new version, we cannot align OUT to IN. We align IN and OUT in their separate columns no matter one parameter has IN or not. (in Compact option, they will not be aligned at all).

  2. Maybe I don’t really get your point of 2nd issue. But according to my comparison on my result to your old one, I found a difference that the parenthese in the line of “IF NOT my_boolean_function(param1” stayed with a parameter but the one in new version standed alone at the end of line. The behaviour of new version can be easily understood. It follows the setting in Parentheses page. I believe you select the 4th option following Andre’s comment. This made any parentheses get formatted like it. Back to the old version, it should be a mistake that the parentheses were not formatted the same when you had already check two checkboxes:“In stacked list, the open parenthesis is on the first item’s line”+“In stacked list, the closing parenthesis is on the last items’s line”.

The most similar text to your old one I get from new formatter is below. I selected the 3rd option in Parentheses page. I hope this can help.

Thanks,
Vincent

PROCEDURE my_proc(param1 IN VARCHAR2
, param2 IN VARCHAR2
, param3 OUT VARCHAR2
, result_code IN OUT NUMBER) IS
BEGIN
IF NOT my_boolean_function(param1
, param2
, constant_package1.constant1
, constant_package1.constant2) THEN
result_code := 1234;
RETURN;
END IF;

INSERT INTO my_table(field1, field2, reg_date, reg_time)
VALUES (param1, param2, TRUNC(SYSDATE), TO_CHAR(SYSDATE, ‘HH24:MI:SS’));
result_code := 0;
END my_proc;
/* Formatted on 12/2/2008 7:44:59 PM (QP5 v5.120.811.25008) */

Vincent
in_out_alignment.jpeg


#8

Hi

The main point here is that is it possible to have different parenthesis options for “parameter declaration” and for “others”? Just if I have self describing procedure names (not the shortest ones) - then I really like the “new verson 4” (by Andre) of Positioning around Multi-line Lists.

But inside the procedure to have more compact flow …like the classic “wrapped” list.

Just when declaring parameters then they(parameter names and types), are emphasized. Inside program when passing parameters they are not. Specially when parameters are passed by position, not by name. Already I see that not all procedures are affected by formating. I totally agree that it would be stupid to see LF/CR inside every Trunc() or to_char() …

Is it possible to get new formatter version separately form SQL Navigator or only with next beta? (I see you have /* Formatted …(QP5 v5.120.811.25008) */ vs my v5.119…)


#9

Hi Marko,

From what I understand, our formatter doesn’t have different parenthesis options for “parameter declaration” and for “others”. The option of Positioning around Multi-line Lists in Parentheses page will affect to “parameter declaration” and to “others” too.
I will forward your idea to Andre.

Regarding the formatter version, it has no direct relation with SQL Nav build number. We had updated it to v5.120 for our internal builds and for the coming 6.1 GA release. But it was still v5.119 in the latest Beta 1090.

Vincent


#10

Marko,

It’s genuinely as Vincent said: ideally there should be more combinations of options. Okay, it’s on the list.

Thanks,
Andre