Tag block of code to exclude from or use different formatting
Allow adding special tags as comments before a block of code (begin - end) to exclude it from being formatted (just indent the whole section together to proper indent level), or perhaps to signal to use a different formatting profile.
i.e. /format exclude/ or /format profile 2/
![](https://secure.gravatar.com/avatar/4a08db224633e9c11dc26d79f378bf58?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
We would like to let you know that we have released dbForge SQL Complete, v4.5.167 Beta where the ‘Do not format tag’ feature is implemented http://www.devart.com/dbforge/sql/sqlcomplete/download.html
Please see the following examples:
- noformat endnoformat
SELECT a.AbsenceCode, a.Code FROM Absence a
-
— noformat
SELECT a.AbsenceCode, a.Code FROM Absence a
/* endnoformat */
/* noformat /
SELECT a.AbsenceCode, a.Code FROM Absence a
/ endnoformat */
/* noformat */
SELECT a.AbsenceCode, a.Code FROM Absence a
— endnoformat
We will be looking forward to you feedback on the new feature.
-
Joel Brown commented
thanks for this enhancement, just wondering how the causal user would figure out this feature?
-
Joel Brown commented
Feedback on this feature:
it is helpful.
I would like to tweak it one bit: proper line indentation should still be applied.
Alternatively it could be a an option in the settings, or you may define another keyword for this behavior.
thanks.
-
KJ commented
This is an awesome idea! Poor Man's T-SQL Formatter uses the quite simple [noformat] .. [/noformat] tags in a comment. It also has a [minify] .. [/minify] option to compact formatting irrespective of legibility. Super useful stuff.
I know all this because I was recently forced to use Poor Man's to pre-format a large number (300+) of SQL source files before applying SQL Complete formatter to get around some missing functionality from SQL Complete. devart's formatter is really class-leading, but for the missing stuff (e.g. better handling of arithmetic operators, function parameters, and generalized wrapping) we still have to carefully hand-format. We would love a way to preserve small amounts of hand-formatting while still being able to apply SQL Complete formatter on a regular, automatic basis.