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

DSLX formatter removes comments around proc channel declarations #1476

Open
mikex-oss opened this issue Jun 12, 2024 · 1 comment
Open

DSLX formatter removes comments around proc channel declarations #1476

mikex-oss opened this issue Jun 12, 2024 · 1 comment
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter

Comments

@mikex-oss
Copy link
Collaborator

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 mikex-oss added bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter labels Jun 12, 2024
@mikex-oss mikex-oss changed the title DSLX formatter removes comments above proc channel declarations DSLX formatter removes comments around proc channel declarations Jun 12, 2024
@mikex-oss
Copy link
Collaborator Author

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

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
Projects
None yet
Development

No branches or pull requests

1 participant