documentation for the formattingstyle schema?

I'm running SP4ADS v0.2.2.0 but it isn't clear to me what some of the settings do.

E.g. 
"casing": {
    "useObjectDefinitionCase": false
  },
  "dml": {
    "clauses": {},
    "listItems": {}
}

Is there any available documentation on these settings?

Thanks for making SQLPrompt for ADS.  I'm pretty much using ADS instead of SSMS 99% of the time now.  Having SQLPrompt formatting is great.  Especially hoping you'll continue to add all the fine-tuning features for formatting I'm still  longing for from the SSMS version.
Tagged:

Answers

  • @DeeTron

    When creating the style file, there should be in-built help that pops up within the file itself as you are typing:





    You can trigger it by pressing Ctrl+Space in the file.

    If there are any settings that you are not clear on, please don't hesitate to ask for further help.

    Software Engineer
    Redgate Software
  • DeeTronDeeTron Posts: 3 New member
    Thanks, Adrian.  That helped.  One thing I noticed while refining my formatting style to my liking.

    If I am in the caseExpressions object and in the value for the "thenAlignment" property and hit CTRL-Space, there is an extra suggestion that I think is a typo.  I see four suggested values: indentedFromWhen, intentedFromWhen, toWhen, toWhenExpression.

    I think the intentedFromWhen is a typo in the extension's codebase.  Here is a screenshot.



    Here is the base JSON you'll need for the recreate:

    "caseExpressions": {



    P.S. it seems that on the red-gate.com login page the username(email address) is case-sensitive.  If I'm correct about that, it would be nice to mention that on the login screen here.
  • @DeeTron Thanks for letting us know. That is indeed a typo. It's now been fixed and will be released in the next version of the ADS extension.
    Software Engineer
    Redgate Software
  • aisbergaisberg Posts: 15 Bronze 1
    edited December 22, 2020 7:53AM
    This is a bit helpful, but it could be improved.

    When I create a new formattingstyle I am asked to select a master. After this I have a ready json file.
    I miss a way to see and compare all predefined styles to get an idea how they are different.

    When I hoover on the left part of the definition I get some help, this is fine. But there is no hint on hoovering the possible values. Maybe this is not supported by ADS. I first need to delete the content, and only then I get a list of available values. And I can do this only value per value. I miss an overview.

    I think you could or better should add a description of possible content and values to the readme file of the extension.
  • aisbergaisberg Posts: 15 Bronze 1
    There is a big issue: before I get some hint for possible values I need to start to write a value with any letter. But when I don't know the allowed values I will not find them. For example, I want to replace the "lowercase" by some valid value, but if I remove the "lowercase" I get no hint. Now I need to try the whole alphabet from a to z, and sometimes I will get some possible values, sometimes not. But I will never get the whole list of all possible values.

    This is very hard to use. I think I could find a style I need, but it is too complicated without any documentation of available values for all settings.
  • Hi @aisberg

    As Adrian said above, if you place your cursor in the file where you would like to replace the value and press CTRL-SPACE you will see the drop down menu with a list of the allowed values. 

    This can be done to find properties:


    or property values:



    Its also worth noting if you have SQL Prompt in SSMS 10.5.3 and SQL Prompt in ADS 0.2.5 you can create and edit your styles using the formatting styles GUI in SSMS.

    Hopefully this helps,

    Thanks, 

    Owen
    Software Engineer
    SQL Prompt / SQL Search
  • aisbergaisberg Posts: 15 Bronze 1
    @ostandage
    OK, I got it. I need to place the Cursor between the ":" and the current value, then on CTRL-SPACE I get a full list. This works.

    My ADS Version of SQL Prompt is 0.2.4
    ADS is showing me that this is the current version. And there is no download link in the readme file or in ADS. Normally I get the download link only when I get a notification in ADS about a new version.
    Maybe you could add the download link in the readme file? It is hard to find the right web link of the plugin because ADS has a restricting encapsulation to avoid users to move to the original resource site using a normal browser.

    I don't use SQL Prompt in SSMS because it is not free. I used the free APEX SQL tools for many years instead of red gate non-free tools. But now Apex stopped to deliver freeware. That's why now I have a look on red gate products again.
  • Hi @aisberg

    Thanks for your suggestions, we'll likely look into improving the update / download experience of SQL Prompt in ADS in the future. 

    Thanks, 

    Owen
    Software Engineer
    SQL Prompt / SQL Search
  • aisbergaisberg Posts: 15 Bronze 1
    @ostandage
    I found the link in the first topic of this forum here. I see it is a very new version. And it is easier now to see possible values using the path on the top.

    Of course, it would be easier to use the formatting settings dialogs of the plugin in SSMS. I know reg-gate plugins from some projects in the past where I was allowed to use red-gate software. Many years ago I even got a T-shirt "friends of red-gate" and I got a developer license to be able to use and to promote. But it is often hard to promote tools because there is one budget and process for consulting and another process for software. Often software needs to be "listed" to be allowed. So the only chance for me to use red-gate software was when the company will buy these tools for all developers. In most other projects I need to use what they have, for example the features in SSDT.

    ADS can be installed per user, without admin rights, and that's why it is easy to use in any project. And I am looking for methods to be used in projects where I don't get admin rights.

    Would be fine to get free refactoring also in ADS, with SQL-Prompt. Currently, the free ways are SSDT or the old standalone APEXSql Refactor.
  • aisbergaisberg Posts: 15 Bronze 1
    I still from time to time try to use the sql-prompt formatting. But normally I give up. Because it is very hard to change the configuration if there is no GUI like in SSMS. I can't use SQL Prompt in SSMS because I have no license.

    Could you consider publishing the complete list of all possible settings for formatting? If a user can see, what is possible, then it will be much easier to find the possible settings.

    For now, I switched back to Poor Mens formatter, because it is free and is available in SSMS and in VSC. But I am not really happy with the result. It would be fine to use the same free formatter in VSC, ADS and SSMS and to be able to configure it a bit. Especially, when working in a team in an open source project, then there should be some free formatting options.
  • Hi @aisberg,
    Could you consider publishing the complete list of all possible settings for formatting?
    If you look in the SQL Prompt extension's installation directory (usually in C:\Users\[username]\.azuredatastudio\extensions\), there is a file inside the Styles directory called full-style.json.example that contains all options and all possible values. There is a schema for the json file in that directory as well, in case you are using a tool that supports it.
    Software Engineer
    Redgate Software
  • aisbergaisberg Posts: 15 Bronze 1
    @AdrianB
    Thank you! This is exactly, what I was searching for.

    Could you consider adding this hint in the documentation of the extension? Then other users also would be able to easy find it.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file