"Format > Case" bug

Provides intelligent code completion for SQL Server editors.

Moderators: Anu Deshpande, Aaron Law, David Priddle

"Format > Case" bug

Postby JimF » Wed Jun 18, 2014 9:42 pm

In 6.3.0.354 you started supporting CamelCase options (Great!!!), but I wanted my built-in data types to be lowercase. Not all data types are being handled correctly (in context of where they are used). For example,
Code: Select all
Declare @TempTable table (...)
becomes
Code: Select all
Declare @TempTable Table (...)
where the datatype "table" gets camel cased.
JimF
 
Posts: 20
Joined: Tue Jul 08, 2008 7:55 pm

Postby Aaron Law » Thu Jun 19, 2014 11:07 am

Hi Jim,

Thanks for pointing this out - it looks like Prompt is applying the reserved word casing here as it sees "Table" as one. We'll improve the casing context awareness so it's correctly cased as a data type where appropriate. Hopefully we'll have a fix in our next beta build next week, I'll let you know when it's up.

Thanks,
Aaron.
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby Aaron Law » Fri Jun 20, 2014 1:07 pm

We've just released a beta build for 6.4.0.204 which should case "Table" as a datatype in declare statements, you can download this build from here.

Please let us know if this works as expected.

Thanks,
Aaron.
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby JimF » Fri Jun 20, 2014 3:01 pm

Wow, that was quick! Yup, that fixed the casing of the "table" data type. But, I also noticed something else.

My code
Code: Select all
Insert  Into @Committees
        ( CommitteeId,
          IsMasterAccount
        )
      Select  cgca.CommitteeId,
            cgca.IsMasterAccount
      From    dbo.Comm_GetCommitteeAccounts(@CommitteeId) As cgca


became
Code: Select all
Insert  Into @Committees
        ( CommitteeId,
          IsMasterAccount
        )
Select  cgca.CommitteeId,
        cgca.IsMasterAccount
From    dbo.Comm_GetCommitteeAccounts(@CommitteeId) As cgca


The indenting of the Select under the Insert was removed. You used to indent the Select to align with the ")" of the column list. Was that change intentional?
JimF
 
Posts: 20
Joined: Tue Jul 08, 2008 7:55 pm

Postby Aaron Law » Fri Jun 20, 2014 3:10 pm

Hi Jim,

This change was intentional - it was requested here. Do you prefer the previous indentation style?

Thanks,
Aaron.
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Re:

Postby JimF » Fri Jun 20, 2014 3:26 pm

Aaron Law wrote:Hi Jim,

This change was intentional - it was requested here. Do you prefer the previous indentation style?

Thanks,
Aaron.


Well, I could live with the change, but what I liked about it was that it made it more obvious to me that the Select was part of the Insert and not a statement on it's own.
JimF
 
Posts: 20
Joined: Tue Jul 08, 2008 7:55 pm

Postby Aaron Law » Fri Jun 20, 2014 3:36 pm

That makes sense.

One of the risks with changing the formatting is everyone has a different preferences :) It looked like it was originally an oversight in the code so we hoped it'd be a safe change to make. I'll have a talk with the rest of the team, maybe we can put in another option for this or it might be best left with the old style until we start focusing on formatting later in the year.
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby Aaron Law » Mon Jun 23, 2014 3:10 pm

Hi Jim,

I've just uploaded another beta (6.4.0.206) with this as an option (off by default, so you shouldn't need to do anything to keep the old behaviour). Sorry for the inconvenience!
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Re:

Postby JimF » Mon Jun 23, 2014 3:31 pm

Aaron Law wrote:Hi Jim,

I've just uploaded another beta (6.4.0.206) with this as an option (off by default, so you shouldn't need to do anything to keep the old behaviour). Sorry for the inconvenience!


Hey, no problem. Formatting can be such a personal thing--as it is, years ago I used some software that formatted the code differently than SQL Prompt (don't remember the name)--I just got used to the way SQL Prompt formatted after a while...
JimF
 
Posts: 20
Joined: Tue Jul 08, 2008 7:55 pm


Return to SQL Prompt 6

Who is online

Users browsing this forum: No registered users and 0 guests