Trying the IndentBeginToken format option and found an issue

DaveBDaveB Posts: 11
edited April 13, 2011 4:50AM in SQL Prompt Previous Versions
I typically don't indent begin statements and so I started hunting through your xml and found the file FormattingOptions.xml and the formatting option IndentBeginToken. This does just what I want; however, when I set the value to False, the contents of my stored procedures indent unexpectedly. In order words, when I set IndentBeginToken to false, my begin statements no longer indent, as I hoped, but the first begin statement of my stored procedure does indent, similar to how the "Indent contents" option works, which I always leave off.

It would be nice if the schema block did not indent when this setting is changed.

Comments

  • I just turned the "Indent contents" under "Schema statements" on while leaving the option "IndentBeginToken" set to False and now the initial begin statement of my stored procedure does NOT indent which is what I was trying to achieve! So now it works exactly how I want but this seems like a small issue.

    To recap:
    1. Set IndentBeginToken to False in the RedGate_SqlPrompt_Format_Layout_LayoutOptions.xml file.
    2. Uncheck "Indent contents" under "Schema statement"
    3. Run formatting and contents Do indent
    4. Check "Indent contents" and rerun formatting and contents do Not indent

    -Dave
  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post.

    Is it working as per your expectation now?

    Do you need any help with this (I am bit confused :( )?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Sorry for not being clear. The result is exactly what I want but the settings to achieve the result are not what I expected. The issue appears to be that there is a conflict between the IndentBeginToken setting and the DoNotIndentProcedureContents setting in RedGate_SqlPrompt_Format_Layout_LayoutOptions.xml.

    If I set IndentBeginToken = False and DoNotIndentProcedureContents = True, my stored procedure contents are indented.

    If I set IndentBeginToken = False and DoNotIndentProcedureContents = False, my stored procedure contents are NOT indented.

    This means that the DoNotIndentProcedureContents logic is backwards when IndentBeginToken = False.

    -Dave
  • Anu DAnu D Posts: 876 Silver 3
    I don't think doing changes in Config file will help.

    Can you let me know the issue you are having and what exact formatting you need I will try replicating it at my end?

    After investigating I can either log a bug or feature request for you (if needed)?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • I'm trying to report a bug. The bug is that the setting DoNotIndentProcedureContents does not work correctly when IndentBeginToken equal False. The bug is reproduced by editing the config file because there is no way to change the IndentBeginToken setting through the UI. The edits I made are:

    CASE 1:
    IndentBeginToken = False 
    DoNotIndentProcedureContents = True
    

    PROBLEM:
    This causes the contents of a stored procedure to be indented. It should not.

    CASE 2:
    IndentBeginToken = False 
    DoNotIndentProcedureContents = False
    

    PROBLEM:
    This causes the contents of a stored procedure to not be indented. It should be indented.

    If you set IndentBeginToken to True, then DoNotIndentProcedureContents works as expected.

    -Dave
  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post Dave!

    I have forwarded your issue to development guys.

    They will have a look at it.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
Sign In or Register to comment.