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

Formatting an impl with a trailing comment is impossible #1858

Open
dplassgit opened this issue Jan 15, 2025 · 0 comments
Open

Formatting an impl with a trailing comment is impossible #1858

dplassgit opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end

Comments

@dplassgit
Copy link
Collaborator

dplassgit commented Jan 15, 2025

Describe the bug

If there is a comment between the end of the last function and the end of an impl, the impl cannot be formatted.

To Reproduce
Steps to reproduce the behavior:

  1. Format
struct MyStruct{}

impl MyStruct {
    fn my_function() -> u32 { u32:3 }
    // Format
}
  1. See error
Formatting failed: Error: INTERNAL: Formatting was skipped because a comment at (filename) would be deleted by the formatter: // Format
This is probably due to a bug (which may not have been reported yet). To complete formatting, try moving the comment to a different line.

Expected behavior
It formats it

@dplassgit dplassgit added bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end dslx:fmt DSLX auto-formatter labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end
Projects
Status: No status
Development

No branches or pull requests

1 participant