xls
xls copied to clipboard
Inline comments on enums values are moved
A very common way to document enums is to add EOL comments to the constants:
bazel-bin/xls/dslx/dslx_fmt - <<EOF
enum Foo : u8 {
X = u8:1, // Description of X
Y = u8:2, // Description of Y
Z = u8:3, // Description of Z
}
EOF
... after formatting, the outcome is less helpful:
enum Foo : u8 {
X = u8:1,
// Description of X
Y = u8:2,
// Description of Y
Z = u8:3,
// Description of Z
}
It should have been putting them /before/ the item, but also we have support for inline comments on struct field members, need to factor out the handling so it's common to all "member items" definitions.