Skip to content

Balance spacing around = #1694

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

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented May 23, 2023

When the leading or trailing trivia was empty it was replacing the present nodes trivias

@kimdv kimdv requested a review from ahoppen as a code owner May 23, 2023 11:28
@kimdv kimdv linked an issue May 23, 2023 that may be closed by this pull request
@kimdv kimdv force-pushed the kimdv/1609-space-is-not-balanced-around-=-for-fix-its branch from b0929a1 to 9b84e5c Compare May 24, 2023 16:51
When the leading or trailing trivia was empty it was replacing the present nodes trivias
@kimdv kimdv force-pushed the kimdv/1609-space-is-not-balanced-around-=-for-fix-its branch from 9b84e5c to 43927e8 Compare May 24, 2023 16:51
@@ -978,7 +979,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor {
fixIts: [
FixIt(
message: ReplaceTokensFixIt(replaceTokens: [.binaryOperator("==")], replacements: [node.equal]),
changes: [.makeMissing(unexpected), .makePresent(node.equal, leadingTrivia: [])]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found two places where we don't need to add trivia

Copy link
Member

Choose a reason for hiding this comment

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

Nice. I suspect there might be a few more as well. Haven’t checked though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to do a quick look, didn't find any

Copy link
Member

Choose a reason for hiding this comment

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

OK, maybe there aren’t any more left. Even better. It was just a gut feeling without looking at the code.

@kimdv
Copy link
Contributor Author

kimdv commented May 24, 2023

@swift-ci please test

@kimdv kimdv requested a review from ahoppen May 24, 2023 16:52
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks

@kimdv kimdv enabled auto-merge May 24, 2023 17:59
@kimdv kimdv merged commit 480f06c into swiftlang:main May 24, 2023
@kimdv kimdv deleted the kimdv/1609-space-is-not-balanced-around-=-for-fix-its branch June 5, 2023 13:33
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.

Space is not balanced around = for Fix-Its
2 participants