Repository navigation
feat(format): leave a statement alone with -- maxdop-ignore - #38
Merged
Merged
Conversation
exclude costs a whole file its formatting and the baseline stops forgiving on the first edit, so there was no way to protect one hand-aligned INSERT ... VALUES grid or CASE ladder. An own-line `-- maxdop-ignore` (or `/* maxdop-ignore */`, optionally followed by a reason) now passes the next statement through verbatim, and the rest of the file formats as usual. The directive is found in the trivia directly above the statement rather than in its attached comments, because a comment above a batch's first statement can be attached to the batch. Ignored statements keep their layout relative to their own first line, so inside a re-indented block they move as a unit; the existing passthrough re-indent would have pulled an aligned grid back to the margin. Next-statement scope only, as Prettier does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
exclude costs a whole file its formatting and the baseline stops forgiving on the first edit, so there was no way to protect one hand-aligned INSERT ... VALUES grid or CASE ladder. An own-line
-- maxdop-ignore(or/* maxdop-ignore */, optionally followed by a reason) now passes the next statement through verbatim, and the rest of the file formats as usual.The directive is found in the trivia directly above the statement rather than in its attached comments, because a comment above a batch's first statement can be attached to the batch. Ignored statements keep their layout relative to their own first line, so inside a re-indented block they move as a unit; the existing passthrough re-indent would have pulled an aligned grid back to the margin. Next-statement scope only, as Prettier does.