Configure Code Formatter By Example
Make it easier to configure the code formatter. Some ideas: 1. Make the code example in the preview pane a COMPREHENSIVE example (i.e. the minimum number of cases of different SQL constructs that would illustrate the current formatting configuration.) 2. Possibly make this a separate dialog or screen so that one could see the effects in the preview pane in realtime as one changes the custom configuration. 3. Consider ...more »
Make it easier to configure the code formatter.
Some ideas:
1. Make the code example in the preview pane a COMPREHENSIVE example (i.e. the minimum number of cases of different SQL constructs that would illustrate the current formatting configuration.)
2. Possibly make this a separate dialog or screen so that one could see the effects in the preview pane in realtime as one changes the custom configuration.
3. Consider building a "Format Analyzer" that reads a template file. You'd supply the user this template file containing a set of SQL constructs and different cases that the user needs to consider. The user would manually format a copy of the template using whatever editor they like (TOAD, or something else) and make it look like they want it. Then feed it to the Format Analyzer which does its best to produce a configuration that would produce that formatting.
When the analysis is done, it should produce a report of the settings it chose, and why, and a machine-formatted output of the configuration template so the user can compare their input with it.
== Obviously there are a lot of ways this feature could "go wrong," but don't dismiss the idea yet! ==
If the user deletes stuff, or moves it around, or adds extraneous things to the template so the analyzer has trouble working, scold the user for doing that (!!) :-) and tell them to try again from a clean copy of the template. (Ease of use doesn't come for free and no SQL developer in their right mind should expect the program to exhibit human understanding!)
The analyzer may find 2 different values for a setting, neither of which exactly reproduce the user's formatting, but both of which are pretty close. Choose 1 arbitrarily and, when done, create a report window (or some kind of output) listing these pairs of choices, including what the setting is, what the 2 choices were, and what the unchosen alternative would have produced.
It is conceivable the analyzer might be forced into a mutually-exclusive pair of choices if the user's formatting is creative enough. (Maybe they right-aligned keywords everywhere except in one or two places, for example?) Again, do the same treatment as above: choose 1 arbitrarily and report on the either/or choice and why the user's example forced this.
« less full details »
To Toad for SQL Server community

Social Web