Forums » Toad for SQL Server Beta

Thread: Code formatter leading comma with space adding two spaces after
comma?


Permlink Replies: 10 - Pages: 1 - Last Post: Mar 17, 2012 2:30 AM by: avergison
DarrenM


Posts: 167
Registered: 2/17/10
Code formatter leading comma with space adding two spaces after
comma?

Posted: Dec 20, 2011 3:01 PM
  Click to reply to this thread Reply





In Toad 5.6 when I choose the code formatter option for leading comma with
space:

, [SomeField]

I’m getting a whole bunch of leading spaces followed by the comma, then
two spaces:

, [

Unfortunately, for me it means I cannot use the code formatter.

I think this was working fine until one day I accidentally changed to one of the
built in formatting styles. Now no matter what I do I cannot seem to get rid of
the 2nd space after the comma.

Darren



Darren
avergison

Posts: 61
Registered: 5/25/06
Re: Code formatter leading comma with space adding two spaces after comma?
Posted: Feb 29, 2012 11:33 AM   in response to: DarrenM
  Click to reply to this thread Reply

Hello Darren,

Could you please send me the snippet that exhibits the error? Can you also send a copy of the options? You can copy the options by opening the options gui and click on "Copy options to clipboard" on the tab near the top of the tree.

Please send to my email at Quest:  andre.vergison@q......

Thanks,
Andre



DarrenM


Posts: 167
Registered: 2/17/10
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 1, 2012 12:12 PM   in response to: avergison
  Click to reply to this thread Reply





It really doesn’t matter what the SQL statement is. For me it does it 100%
of the time.

Example:

SELECT [name], [object_id], [type], [schema_id], principal_id, type_desc,
create_date, modify_date, is_ms_shipped, is_published FROM sys.objects

Formats as:

SELECT [name]

, [object_id]

, [type]

, [schema_id]

, principal_id

, type_desc

, create_date

, modify_date

, is_ms_shipped

, is_published

FROM sys.objects

Darren



Darren
hfreeman

Posts: 760
Registered: 3/16/09
RE: Re: Code formatter leading comma with space adding two spaces after comma?
Posted: Mar 1, 2012 6:39 PM   in response to: DarrenM
  Click to reply to this thread Reply
Attachment image002.png (11.9 K)
Attachment image003.gif (1.1 K)
Attachment image004.jpg (1.3 K)
Attachment image005.jpg (20.5 K)
Attachment image001.png (56.7 K)





Darren!

I tried your sql statement because I use the leading comma format as well, I use
the Long Format Leading Uppercase, so I know how frustrating this can be !!!

Here is my example and my ‘copy to options to clipboard’, which you
can use to compare it to yours as well as over write yours, IF YOU CHOOSE!!!

Andre, mine works just fine, so I hope my submission help you and my friend
Darren.

Formatter Options GUI version 5.182.0

=== Text Format ===

[Qp5FormatterOptions]

Version = 145

InputTabs = 3

OutputTabs = 2

IndentSize = 2

IndentAfterProcs =
htp.blockquoteOpen\nhtp.bodyOpen\nhtp.centerOpen\nhtp.dirlistOpen\nhtp.dlistOpen\nhtp.fontOpen\nhtp.formOpen\nhtp.formSelectOpen\nhtp.formTextareaOpen\nhtp.framesetOpen\nhtp.headOpen\nhtp.htmlOpen\nhtp.listingOpen\nhtp.mapOpen\nhtp.menulistOpen\nhtp.noframesOpen\nhtp.preOpen\nhtp.tableOpen\nhtp.tableRowOpen\nhtp.ulistOpen\n

RightMargin = 80

LF_ConsecLFLimit = 2

BuiltInCase = 0

BuiltInPackageCase = 0

ParamDeclDynMinSpace = 1

AssignAlignment = 2

AssignAlignmentDynMinSpace = 1

AssignFavorWrapping = 0

CommaStyle = 1

ParensStyle = 0

AndOrStyle = 1

AndOrOperatorPos = 3

AddMulOperatorPos = 2

CommentsRightJustifyTrailing = 0

DefaultArrangement = S

DefaultArrangeOnCol = 1

DefaultListParens = 3

ParamDeclArrangeOnCol = 1

CreateTableArrangement = D

CreateTableListParens = 6

CreateViewArrangement = D

CreateViewListParens = 6

DmlKeywordsLeftAligned = 3

DmlMiddleMargin = 2

DmlRhsAlignment = 0

Tagline = 0

[PlfOptionsOracle]

ProfilerSelectListThreshold = 5

ProfilerNestedIfsThreshold = 5

ProfilerNestedLoopsThreshold = 5

ProfilerParamsThreshold = 5

=== XML Format ===

<OptionsGUI>5.182.0</OptionsGUI>

<Version>145</Version>

<InputTabs>3</InputTabs>

<OutputTabs>2</OutputTabs>

<IndentSize>2</IndentSize>

<IndentAfterProcs>htp.blockquoteOpen\nhtp.bodyOpen\nhtp.centerOpen\nhtp.dirlistOp
en\nhtp.dlistOpen\nhtp.fontOpen\nhtp.formOpen\nhtp.formSelectOpen\nhtp.formTextar
eaOpen\nhtp.framesetOpen\nhtp.headOpen\nhtp.htmlOpen\nhtp.listingOpen\nhtp.mapOpe
n\nhtp.menulistOpen\nhtp.noframesOpen\nhtp.preOpen\nhtp.tableOpen\nhtp.tableRowOp
en\nhtp.ulistOpen\n</IndentAfterProcs>

<RightMargin>80</RightMargin>

<LF_ConsecLFLimit>2</LF_ConsecLFLimit>

<BuiltInCase>0</BuiltInCase>

<BuiltInPackageCase>0</BuiltInPackageCase>

<ParamDeclDynMinSpace>1</ParamDeclDynMinSpace>

<AssignAlignment>2</AssignAlignment>

<AssignAlignmentDynMinSpace>1</AssignAlignmentDynMinSpace>

<AssignFavorWrapping>0</AssignFavorWrapping>

<CommaStyle>1</CommaStyle>

<ParensStyle>0</ParensStyle>

<AndOrStyle>1</AndOrStyle>

<AndOrOperatorPos>3</AndOrOperatorPos>

<AddMulOperatorPos>2</AddMulOperatorPos>

<CommentsRightJustifyTrailing>0</CommentsRightJustifyTrailing>

<DefaultArrangement>S</DefaultArrangement>

<DefaultArrangeOnCol>1</DefaultArrangeOnCol>

<DefaultListParens>3</DefaultListParens>

<ParamDeclArrangeOnCol>1</ParamDeclArrangeOnCol>

<CreateTableArrangement>D</CreateTableArrangement>

<CreateTableListParens>6</CreateTableListParens>

<CreateViewArrangement>D</CreateViewArrangement>

<CreateViewListParens>6</CreateViewListParens>

<DmlKeywordsLeftAligned>3</DmlKeywordsLeftAligned>

<DmlMiddleMargin>2</DmlMiddleMargin>

<DmlRhsAlignment>0</DmlRhsAlignment>

<Tagline>0</Tagline>

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn.com

678.414.0090 my cell Primary

Hank.Freeman50 (Skype)




DarrenM


Posts: 167
Registered: 2/17/10
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 14, 2012 11:35 AM   in response to: hfreeman
  Click to reply to this thread Reply
Attachment image006.png (41.8 K)
Attachment image007.png (56.7 K)
Attachment image008.png (11.9 K)
Attachment image009.jpg (20.5 K)
Attachment image010.gif (1.1 K)
Attachment image011.jpg (1.3 K)





Hank, thanks for that reply, but the option you chose isn’t the comma with
space option:

My issue is that choosing “Leading with space” is behaving as
“Leading with two spaces”, but I’m expecting it to behave as
“Leading with one space”.

Your results show “Leading” (i.e. with no space).

Darren



Darren
hfreeman

Posts: 760
Registered: 3/16/09
RE: Re: Code formatter leading comma with space adding two spaces after comma?
Posted: Mar 14, 2012 5:08 PM   in response to: DarrenM
  Click to reply to this thread Reply
Attachment image001.gif (1.1 K)
Attachment image002.jpg (1.3 K)
Attachment image003.png (41.8 K)
Attachment image004.png (56.7 K)
Attachment image005.png (11.9 K)
Attachment image006.jpg (20.5 K)
Attachment image007.jpg (1.3 K)





I see now, what you wanted… I will see what works here on this end.

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn.com

678.414.0090 my cell Primary

Hank.Freeman50 (Skype)




avergison

Posts: 61
Registered: 5/25/06
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 16, 2012 12:41 AM   in response to: DarrenM
  Click to reply to this thread Reply
Attachment image002.jpg (13.7 K)





Thanks for the example. However at this time I still can?t reproduce it. Could
you please send me the set of options?


Thanks,

Andre




DarrenM


Posts: 167
Registered: 2/17/10
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 16, 2012 8:25 AM   in response to: avergison
  Click to reply to this thread Reply
Attachment image001.jpg (13.7 K)





Formatter Options GUI version 5.182.0

=== Text Format ===

[Qp5FormatterOptions]

Version = 145

CommaStyle = 2

DmlKeywordsLeftAligned = 1

DmlRhsAlignment = 0

[PlfOptionsOracle]

=== XML Format ===

<OptionsGUI>5.182.0</OptionsGUI>

<Version>145</Version>

<CommaStyle>2</CommaStyle>

<DmlKeywordsLeftAligned>1</DmlKeywordsLeftAligned>

<DmlRhsAlignment>0</DmlRhsAlignment>



Darren
avergison

Posts: 61
Registered: 5/25/06
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 16, 2012 11:18 AM   in response to: DarrenM
  Click to reply to this thread Reply
Attachment image001.jpg (13.7 K)





Thank you. Could you also tell me the version of the qp5.dll file in the Toad
library (something like 5.190 or so) ? I was hoping the option info below would
have reported it, but this is a more recent feature.

Thanks,

Andre




DarrenM


Posts: 167
Registered: 2/17/10
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 16, 2012 12:46 PM   in response to: avergison
  Click to reply to this thread Reply
Attachment image002.png (30.7 K)
Attachment image003.jpg (13.7 K)





File Version: 5.187.11257.23840

Product Version: 5.0.0.0



Darren
avergison

Posts: 61
Registered: 5/25/06
RE: Re: Code formatter leading comma with space
adding two spaces after comma?

Posted: Mar 17, 2012 2:30 AM   in response to: DarrenM
  Click to reply to this thread Reply
Attachment image003.jpg (33.6 K)
Attachment image004.jpg (13.7 K)





Hello Darren,

This bug was fixed in a later version of that file. I?ll work with Toad team
to provide you a solution.

Sorry not to have found that earlier, I thought it appeared in a newer version,
and 5.187 was released back in Sep 19, 2011. (yes, in IT months are interpreted
as years, apparently)

Thanks for reporting,

Andre




Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums