Formatting of generic discrete type disagrees with GNAT warning
Nobody has claimed this yet.
- Dominant language
- Ada
- Stars
- 21
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Noticed in this code snippet, autoformat in VS Code (with GNATformat) results in this:
generic
type My_Enum is(<>);
package Example is
My_Values : array (My_Enum) of Boolean;
end Example;
GNATformat removed the space between is and (<>) and building with GNAT then gives a (style) space required warning between is and (<>).
This is also duplicated when running GNATformat directly, like with gnatformat --project my_example.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the formatting discrepancy with the generic Ada snippet in the issue, both through VS Code with GNATformat and with gnatformat --project my_example. Trace the formatter’s handling of is (<>);; done means the space is preserved and GNAT no longer reports the (style) space required warning.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100