Skip to content

Fix multiline string when using string interpolation #1335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2023

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Feb 11, 2023

Added some tests cases that fail and a single that pass

@kimdv kimdv force-pushed the kimdv/fix-multi-line-string branch 6 times, most recently from c5aea9e to 3b2d126 Compare February 17, 2023 13:52
@kimdv kimdv force-pushed the kimdv/fix-multi-line-string branch 6 times, most recently from c938faa to 51617e1 Compare February 20, 2023 21:11
@kimdv kimdv marked this pull request as ready for review February 20, 2023 21:11
@kimdv kimdv requested a review from ahoppen as a code owner February 20, 2023 21:11
@kimdv kimdv force-pushed the kimdv/fix-multi-line-string branch 2 times, most recently from 3d89fb1 to b2a4a2c Compare February 23, 2023 08:17
@kimdv kimdv force-pushed the kimdv/fix-multi-line-string branch 2 times, most recently from 323bdbe to 020476f Compare February 23, 2023 14:28
if let keyPath = getKeyPath(Syntax(node)), requiresLeadingNewline(keyPath), !(leadingTrivia.first?.isNewline ?? false) {
leadingTrivia = .newline + leadingTrivia
if let keyPath = getKeyPath(Syntax(node)), requiresLeadingNewline(keyPath), !(leadingTrivia.first?.isNewline ?? false), !shouldOmitNewline(node) {
leadingTrivia = .newline + leadingTrivia
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have hawk eyes! 👀

@kimdv kimdv force-pushed the kimdv/fix-multi-line-string branch from 020476f to cf28464 Compare February 23, 2023 14:56
@kimdv
Copy link
Contributor Author

kimdv commented Feb 23, 2023

@swift-ci please test

@kimdv kimdv force-pushed the kimdv/fix-multi-line-string branch from cf28464 to 057a711 Compare February 23, 2023 20:08
@kimdv
Copy link
Contributor Author

kimdv commented Feb 23, 2023

@swift-ci please test

@kimdv
Copy link
Contributor Author

kimdv commented Feb 23, 2023

@swift-ci please test Linux

@kimdv kimdv merged commit 4727d3c into swiftlang:main Feb 24, 2023
@kimdv kimdv deleted the kimdv/fix-multi-line-string branch February 24, 2023 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants