[ExportVerilog] Bound type size considered for decl alignment #6171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently blindly align the types and names of declarations, which causes excessively large types like structs to ruin the alignment of declarations. Instead, introduce an upper bound above which a type does not contribute towards the
maxTypeWidth
count. This means that excessively large types are just emitted without alignment, without other declarations being forced to follow the same alignment. This change is purely cosmetic.Also tweak the code that emits the spacing around declarations to work by specifying a target column up to which spaces should be filled, and then filling in those spaces, or a minimum of 1. This makes it harder to get the alignment off by 1 just because some type or decl word was empty and didn't need a trailing space.