xls icon indicating copy to clipboard operation
xls copied to clipboard

[dslx:fmt] Support multi-line inline comments (e.g. struct member comments) remaining unchanged during autofmt

Open cdleary opened this issue 1 year ago • 0 comments

In a test case like:

pub struct Point {
  x: u32,  // this is a longer comment
           // it wants to be multi-line for some reason
  y: u32,
}

The autoformatter will unhelpfully dedent your second line because it thinks it's a weirdly indented comment on the y member. We can fix this by coalescing the two pieces into one comment entity in our comment-location-query data structure.

cdleary avatar Jan 23 '24 18:01 cdleary