Format document triggered when parameter help is used

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
joeyfriends666
Posts: 3
Joined: Wed 27 Feb 2013 13:20

Format document triggered when parameter help is used

Post by joeyfriends666 » Wed 27 Feb 2013 13:42

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

alexa

Re: Format document triggered when parameter help is used

Post by alexa » Wed 27 Feb 2013 15:18

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.

joeyfriends666
Posts: 3
Joined: Wed 27 Feb 2013 13:20

Re: Format document triggered when parameter help is used

Post by joeyfriends666 » Thu 28 Feb 2013 07:33

Hi.

Great :) And impressive support, I must add.

Regards,
Martin

alexa

Re: Format document triggered when parameter help is used

Post by alexa » Tue 05 Mar 2013 13:01

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.

joeyfriends666
Posts: 3
Joined: Wed 27 Feb 2013 13:20

Re: Format document triggered when parameter help is used

Post by joeyfriends666 » Wed 06 Mar 2013 07:04

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

alexa

Re: Format document triggered when parameter help is used

Post by alexa » Thu 07 Mar 2013 09:35

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.

Post Reply