How can we help you today? How can we help you today?

Format list items with indent for subsequent items

Prompt is no longer indenting subsequent list items when using tab only. For example, setting Whitespace tab behavior to Only Tabs and formatting the following code using any combination of 'Align Subsequent, Indent List Items):

create table dbo.tmp_dtru02_vehicle
( id bigint identity(1, 1)
, rundatetime_utc datetime null
, audit_createdatetimeutc datetime null
, audit_createdateutc date null
, audit_moddatetimeutc datetime null
, audit_isactive bit null);

results in the following formatted code with subsequent list items not indented with tabs:

create table dbo.tmp_test
(
id bigint identity(1, 1)
, rundatetime_utc datetime null
, audit_createdatetimeutc datetime null
, audit_createdateutc date null
, audit_moddatetimeutc datetime null
, audit_isactive bit null
);


naumad
0

Comments

16 comments

  • Tianjiao_Li
    Hi @naumad

    Thanks for posting and sorry to hear you are having this issue.

    I couldn't reproduce the issue in SQLPrompt_9.0.3.3299. Can you please upgrade and test again?

    Thanks.
    Tianjiao_Li
    0
  • naumad
    I am experiencing different behavior after upgrade, but it is also not the expected behavior. I am expecting that selecting the "Indent List Items" checkbox should indent not only the first list item, but all subsequent list items; see attached picture
    btosn19j5bqa.jpg
    naumad
    0
  • Tianjiao_Li
    Hi @naumad

    Would you be able to share the sample script and style file with us?
    Tianjiao_Li
    0
  • naumad
    select
    TerritoryID
    , Name
    , [Group] -- nvarchar(50)
    , SalesYTD as YearToDate -- money
    , SalesLastYear as LastYear -- money
    from Sales.SalesTerritory
    naumad
    0
  • naumad
    Attached is the style file (zipped). For the above query, I am expecting SQLPrompt to format using all tabs for the list items, starting with the first list item and all subsequent column names indented.
    naumad
    0
  • Tianjiao_Li
    If you change the 'Tab behavior' under 'Whitespace', I assume that's the result you expect.
    I am expecting SQLPrompt to format using all tabs for the list items .....

    - Did you mean you want to use ' Only tabs' ?

    e1r1bsn7kw68.png


    Tianjiao_Li
    0
  • naumad
    Yes, I meant to use "Only Tabs".
    naumad
    0
  • Tianjiao_Li
    Hi @naumad

    You'd have to change the number of spaces in tabs:

    vwm9y9btxgcq.png
    Tianjiao_Li
    0
  • naumad
    Number of spaces in tabs = 4; I still have the same trouble
    naumad
    0
  • Tianjiao_Li
    Hi @naumad

    It appears there is a tab in front of the first item and to align it with the subsequent list, I'm afraid you'll have to change the number of space in tabs to 2. Alternatively, you can use ' Tabs where possible'.
    Tianjiao_Li
    0
  • naumad
    I'm sorry about this - it's becoming a bigger problem than necessary. I simply would like this SQL:
    select
    x
    , date1
    , date2
    , username
    from tablename
    where x = 1 and date1 between '2017-01-01' and '2017-01-31';
    

    to be formatted like this:
    select
    	x
    	, date1
    	, date2
    	, username
    from tablename
    where
    	x = 1
    	and date1 between '2017-01-01' and '2017-01-31';
    

    The indent is one tab created only with standard tabs (not spaces) so that our documentation system will copy the code correctly. This used to work prior to the December 2017 release when the behavior for 'subsequent items' changed. Earlier in this thread, I attached the style file. If this is possible, please let me know which SQL Prompt style settings will accomplish this. If this is not possible and there will be no patch for this, please let me know and I will request a refund from my recent renewal.
    naumad
    0
  • Tianjiao_Li
    Hi @naumad ,

    After further investigation, the option 'Align subsequent items with first item' doesn't seem to work. We've logged this issue as SP-6811 in our internal bug tracking system and will keep you updated.

    Thanks for your patience.
    Tianjiao_Li
    0
  • Tianjiao_Li
    Hi @naumad

    Thanks for your patience with this issue.

    Unfortunately the development team hasn't been able to prioritise this work. Given the size of the backlog of higher-priority items, it doesn't look like it's something we will fix in the foreseeable future.

    However we still have it logged as 
    SP-6811 in our internal bug tracking system and we'll reassess it again in the future. Please keep an eye on the release note!

    Tianjiao_Li
    0
  • naumad
    So the dev team broke something and doesn't have time to fix it in the "foreseeable future".  Is this correct?
    naumad
    0
  • Tianjiao_Li
    Hi @naumad

    The development team had another look and it appears changing the highlighted setting resolves the issue.

    Can you please give it a try?


    Tianjiao_Li
    0
  • naumad
    This appears to work.  Thank you for your help and patience.
    naumad
    0

Add comment

Please sign in to leave a comment.