andrewbaxter / genemichaels

Even formats macros
ISC License
85 stars 5 forks source link

bug: inline comments are destroyed #89

Open wongjiahau opened 4 hours ago

wongjiahau commented 4 hours ago

My code (trimmed):

    fn get_valid_selection(
        get_actual_edit_transaction: impl Fn(
            /* current */ &Selection,
            /* next */ &Selection,
        ) -> anyhow::Result<EditTransaction>,
    ) -> anyhow::Result<Either<Selection, EditTransaction>> {
        todo!()
    }

Error (trimmed):

 Error formatting file
    - file = xxx
    Caused by:
      Error doing formatting
        Caused by:
          Encountered a bug; some comments were lost during formatting
            - comments = [Whitespace { loc: LineColumn { line: 1530, column: 26 }, mode: Comment(Comment { mode: Normal, lines: "current" }) }, Whitespace { loc: LineColumn
                         { line: 1531, column: 23 }, mode: Comment(Comment { mode: Normal, lines: "next" }) }]
wongjiahau commented 4 hours ago

By the way, I just want to express my appreciation of this project, because I'm sick of cargo fmt giving up on lines that are too long.