"Format > Case" bug

JimFJimF Posts: 49 Bronze 3
edited June 23, 2014 10:31AM in SQL Prompt
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,
Declare @TempTable table (...)
becomes
Declare @TempTable Table (...)
where the datatype "table" gets camel cased.

Comments

  • Aaron LAaron L Posts: 596 New member
    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 LAaron L Posts: 596 New member
    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.
  • JimFJimF Posts: 49 Bronze 3
    Wow, that was quick! Yup, that fixed the casing of the "table" data type. But, I also noticed something else.

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

    became
    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?
  • Aaron LAaron L Posts: 596 New member
    Hi Jim,

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

    Thanks,
    Aaron.
  • JimFJimF Posts: 49 Bronze 3
    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.
  • Aaron LAaron L Posts: 596 New member
    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 LAaron L Posts: 596 New member
    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!
  • JimFJimF Posts: 49 Bronze 3
    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...
Sign In or Register to comment.