Conversation
Contributor
Author
|
Note for reviewers: This seems to be bit opinionated issue raised.
|
Laurens-W
approved these changes
Jan 27, 2026
timtebeek
reviewed
Jan 27, 2026
f6b92f7 to
4ead755
Compare
timtebeek
reviewed
Jan 28, 2026
Add a new recipe option `avoidLineContinuations` (default: false) that,
when enabled, avoids using `\` line continuation escapes in text blocks
where the content contains newlines. Non-newline-joined strings are
placed on the same text block line instead.
Previously with the option enabled, "foo\n" + "bar" + " baz" produces:
foo
bar baz
Without the option (default), the existing behavior is preserved:
foo
bar\
baz
Fixes moderneinc/customer-requests#1763
67e90f4 to
2fd94c6
Compare
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.
Summary
UseTextBlocksconverts a string concatenation that mixes newline-terminated strings with non-newline strings, it no longer inserts\line continuations for the non-newline joinsProblem
When converting SQL query string concatenations to text blocks, the recipe inserts
\(line continuation) escapes between adjacent strings that aren't separated by\n. In a mixed concatenation like:The recipe would produce unexpected
\characters:While semantically correct, the
\line continuation is unfamiliar to many developers and perceived as a bug.Solution
Added a
contentHasNewlinesguard to the passPhrase insertion logic. When the concatenated content already contains interior newlines (mixed case), non-newline-joined strings are simply concatenated on the same text block line instead of being split with\continuations:Test plan
Existing tests pass (all 27 UseTextBlocksTest cases)
New tests:
noLineContinuationWhenContentHasNewlines— trailing non-newline stringsNew tests:
noLineContinuationInMixedConcatenation— end-of-query non-newline stringsNew tests:
noLineContinuationInMiddleOfMixedConcatenation— mid-query non-newline joinFixes moderneinc/customer-requests#1763