Repository navigation
Conversation
This branch has not been deployed
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.
Stacked on #959.
With
clauseBodyStyle: compact, a lone select item stays on theselectline inside an indent kept for its continuation lines. #938 listed this as not covered. When the item only breaks inside its own parentheses, a function call for instance, it has no continuation lines, and the indent pushed its arguments two levels in and its)one level in, under nothing. This is the same pattern #938 fixed for WHERE and ON:What changed
The compact select list leaves out the indent for a lone item without an alias that is one of these:
coalesce(...),greatest/least(...)orxmlserialize(...);cast(...)withcastStyle: cast;Anything else keeps the indent, because it can continue on lines of its own: an alias (
... as totalcan wrap), a FILTER clause, an operator chain such asa + b +\n c.The FILTER layout
The other item,
filter (wherekeepingwhereon thefilter (line with)attached to the condition, was already fixed later in the stack:filter (where cond)on one line when it fits, otherwisefilter (,where condindented, and)on its own line.count_star_stays_together_when_the_filter_breaksinfunction_call_layout.rsasserts it, so there is no separate change here.Snapshot changes
All reviewed; one category: a lone call or subquery in a compact select list moves its arguments one level left and closes
)underselect(compact_select_list*,scalar_subquery_expanded).New test
a_lone_compact_select_item_closes_under_selectinsubquery_layout.rs, covering a call and an operator chain that keeps its indent. The option matrix passes.