The formatting is OK (personally I’d put each enumeration vaue on its own line).
It doesn’t compile, because the enumeration values (Endpoint => 7, etc) need to be (a) ordered the same as the enumerals (as you have it, Capability would have to be first) and (b) distinct.
The naming looks a bit odd. I don’t know what Device, Config etc are, but they’re probably not sizes.
type Thing is (Device, Config, ...);
Thing_Size: constant array (Thing) of Interfaces.C.unsigned_char :=
(Device => 18,
Config => 9,
...);
This is a chunk of my libusb bindings code which I extracted out of context.
To narrow down my question, how do I make the VSCode Ada extension formatter put enumeration values each on a separate line? The formatting I posted is the one I get from the extension.
The only way I found to get the formatting I want is to put a comment after each enumeration value which is not ideal from my perspective.
It looks as though the formatting is done by gnatpp, which has an option (--vertical-enum-types) to put each enumeral on a separate line, but none that do what you want.
You can have gnatpp options in your project file and VSCode extension will take them into account. I have these for example:
package Pretty_Printer is
for Default_Switches ("ada") use
("--no-align-modes",
"--no-separate-is",
"--comments-fill",
"--call-threshold=1",
"--par-threshold=2",
"--vertical-named-aggregates",
"--wide-character-encoding=8");
end Pretty_Printer;
libadalang_tools is installed using alr with libadalang_tools. That seems to be a per-project installation, rather than a toolchain installation. Do I understand that correctly? Will I have to re-install it for each project I work on, and if so, will it install multiple copies of the same thing?