google / xls

XLS: Accelerated HW Synthesis
http://google.github.io/xls/
Apache License 2.0
1.21k stars 179 forks source link

Formatter loses comment in the middle of an expression #1739

Open dplassgit opened 1 day ago

dplassgit commented 1 day ago

To Reproduce Enter this into the editor of your choice

fn broken() ->u32 {
    const x = u32:1  + // keep me
        u32:2;
    x
}

Then format it.

Expected behavior

The output is the input.

Actual behavior The comment is deleted:

fn broken() -> u32 {
    const x = u32:1 + u32:2;
    x
}
dplassgit commented 8 minutes ago

Similar for unary operator, cast, etc.