Skip to content
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

Remove duplicated semicolons, without removing newline #216

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

timtebeek
Copy link
Contributor

No description provided.

@timtebeek timtebeek added the bug Something isn't working label Nov 13, 2023
@timtebeek timtebeek requested a review from joanvr November 13, 2023 17:24
@timtebeek timtebeek self-assigned this Nov 13, 2023
.withWhitespace(statement.getPrefix().getWhitespace());
result.add(nextLine.withPrefix(updatedPrefix));
String semicolonPrefixWhitespace = statement.getPrefix().getWhitespace();
if (semicolonPrefixWhitespace.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Only wondering if we instead should be checking for comments (in which case we probably want to leave the statement alone) and if the whitespace contains \n or not. Or what happens when there is ; ; (with a space)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, indeed there was a problem with ; ;. Comments were already extensively tested in the unit test just above, so I expect that to be handled.

@timtebeek timtebeek merged commit aa57012 into main Nov 15, 2023
1 check passed
@timtebeek timtebeek deleted the remove_duplicated_semicolons branch November 15, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants