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

Fix fmt whitespaces between comments and doc comments #5178

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

cr-fuel
Copy link
Contributor

@cr-fuel cr-fuel commented Oct 9, 2023

This is part of #5052

Description

There was a bug in the formatter whenever a comment as followed by a doc-comment, this was due the insert_after_span was not allowed to return a negative offset (due types constraints). But sometimes this function should let their callee know to remove some bytes.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@cr-fuel cr-fuel self-assigned this Oct 9, 2023
@cr-fuel cr-fuel requested a review from a team October 9, 2023 18:07
Copy link
Contributor

@eureka-cpu eureka-cpu left a comment

Choose a reason for hiding this comment

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

Nice one, I left a few suggestions.

swayfmt/src/utils/map/newline.rs Outdated Show resolved Hide resolved
swayfmt/src/utils/map/newline.rs Outdated Show resolved Hide resolved
Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

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

Nice work.

@JoshuaBatty JoshuaBatty requested a review from a team October 9, 2023 22:24
@cr-fuel cr-fuel enabled auto-merge (squash) October 9, 2023 22:26
Copy link
Contributor

@eureka-cpu eureka-cpu left a comment

Choose a reason for hiding this comment

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

Thanks @cr-fuel

@cr-fuel cr-fuel merged commit f12d5d4 into master Oct 9, 2023
28 checks passed
@cr-fuel cr-fuel deleted the cr/fix-spacing-between-comments-and-doc-comments branch October 9, 2023 23:00
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.

3 participants