xls icon indicating copy to clipboard operation
xls copied to clipboard

DSLX formatter removes comments around proc channel declarations

Open mikex-oss opened this issue 1 year ago • 1 comments

Describe the bug After running through dslx autofmt, the comments describing a channel declaration are gone.

To Reproduce Steps to reproduce the behavior:

  1. Take the example adder proc in the proc tutorial and add comments above each channel declaration.
pub proc adder {
  // foo
  A: chan<u32> in;
  // bar
  B: chan<u32> in;
  // baz
  C: chan<u32> out;
  1. Run the formatter or dslx_fmt_test.
  2. You will see the comments removed; test diff shown below:
<   // foo
<   A: chan<u32> in;
<   // bar
<   B: chan<u32> in;
<   // baz
<   C: chan<u32> out;
---
>     A: chan<u32> in;
>     B: chan<u32> in;
>     C: chan<u32> out;

Expected behavior Comments should be preserved.

mikex-oss avatar Jun 12 '24 23:06 mikex-oss

Note inline comments and blank lines (between comment and declaration, or between declarations) doesn't seem to workaround this issue.

mikex-oss avatar Jun 12 '24 23:06 mikex-oss

We think this should be fixed by #1535

cdleary avatar Aug 18 '24 19:08 cdleary