-
Notifications
You must be signed in to change notification settings - Fork 307
Fix for trivia not preserved after string interpolation conversion #1575
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
Fix for trivia not preserved after string interpolation conversion #1575
Conversation
How was Should we also retain the trailing trivia from |
Yeah, AFAIK, string literals don't have trailing trivia, and trailing trivia of any non-string-literal component will be converted and moved into the string interpolation, so the trailing trivia of |
What about |
114a2a8
to
e040e76
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
newText: ###""" | ||
##"[\##(key): \##(d) \##(value)]"## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this line has trailing whitespace. Could you run swift-format on your changes? https://github.com/swiftlang/sourcekit-lsp/blob/main/CONTRIBUTING.md#formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, please test again.
…g interpolation conversion
e040e76
to
db3867b
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
fix an issue in #1551
My bad, I should've tested the code action more thoroughly. The leading trivia of the source
SequenceExprSyntax
is not carried over to the new string literal, resulting in this:->
This fix will preserve the leading trivia, i.e.