Page 1 of 1

Format document triggered when parameter help is used

Posted: Wed 27 Feb 2013 13:42
by joeyfriends666
Hi.

I'm having a curious problem with SQL Complete (4.0.65) - trial edition

It seems that the format document routine is triggered when the parameter auto completion is used from within a stored procedure ... Sometimes....

If I enter the following

Code: Select all

create PROCEDURE xxxxx.xxxxxx
as

select 1,2

exec felineADM.web_sel_AgentInfo

and the cursor is placed after "felineADM.web_sel_AgentInfo".

When I press <ctrl>+<space> it says "Press <tab> to insert a list..."

But when I press <tab> the document is formatted and now looks like this

Code: Select all

create procedure xxxxx.xxxxxx
as

  select
    1,
    2


  exec felineADM.web_sel_AgentInfo @UdbyderNummer = '' /* varchar(10) */,
                                   @AgentNummer = '' /* varchar(10) */,
                                   @AgentID = null /* uniqueidentifier */,
                                   @Refkode = '' /* varchar(20) */
It shouldn't auto-format anything

However this behavior isn't triggered all the time.
IE. If you comment out the "create procedure" part, it doesn't happen.

Otherwise it's a totally awesome plugin.

Regards,
Martin

Re: Format document triggered when parameter help is used

Posted: Wed 27 Feb 2013 15:18
by alexa
We were able to reproduce this issue and will fix it in one of the next product builds. We will notify you once it's available for downloading.

Re: Format document triggered when parameter help is used

Posted: Thu 28 Feb 2013 07:33
by joeyfriends666
Hi.

Great :) And impressive support, I must add.

Regards,
Martin

Re: Format document triggered when parameter help is used

Posted: Tue 05 Mar 2013 13:01
by alexa
A more detailed investigation of the issue showed that such behavior appears to be by design which means that the whole CREATE PROCEDURE, that the EXEC statement belongs to, is formatted in this case.

Re: Format document triggered when parameter help is used

Posted: Wed 06 Mar 2013 07:04
by joeyfriends666
Seriously ? Meaning that this behaviour is not faulty ?

In my opinion. Using a intellisense-autocomplete feature helping the user to insert the available parameters has nothing to do with formatting the rest of the stored procedure.
Fair enough that it formats the EXEC statement itself, but not the rest of the document.

Just my 2 cents.

Regards,
Martin

Re: Format document triggered when parameter help is used

Posted: Thu 07 Mar 2013 09:35
by alexa
Please note that dbForge SQL Complete formats the CREATE PROCEDURE containing the EXEC statement but not the whole document.

Such behavior has advantages as the EXEC statement gets indented inside a CREATE PROCEDURE statement.

Though, this behavior will be reconsidered and may be changed in future product versions.