Better formatting with proc-scoped type aliases
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
### What's hard to do? (limit 100 words)
With https://github.com/google/xls/issues/1050, you can have proc scoped type aliases.
But the DSLX formatter seems to shove the types and channels into one big blob and does not preserve user inserted line breaks.
```
proc Foo {
type Bar = bits[32];
bar: chan out;
baz: chan in;
config(bar: chan out, baz: chan in) { (bar, baz) }
init { () }
next(state: ()) { }
}
```
is reformatted to
```
proc Foo {
type Bar = bits[32];
bar: chan out;
baz: chan in;
config(bar: chan out, baz: chan in) { (bar, baz) }
init { () }
next(state: ()) { }
}
```
### Current best alternative workaround (limit 100 words)
Adding a comment like `//Channels` at least helps delineate where the channel declarations start.
### Your view of the "best case XLS enhancement" (limit 100 words)
Preserve user line breaks which can be helpful for signifying different conceptual clusters of code.
Contributor guide
Assessment
This issue has not been assessed yet.