g2384 / VHDLFormatter

VHDL formatter web online written in typescript
https://g2384.github.io/VHDLFormatter/
MIT License
51 stars 20 forks source link

Set line width #39

Open grigosback opened 3 years ago

grigosback commented 3 years ago

Request a new feature

It would be nice to have an option to set the maximum line width and apply the alignments under that directive.

Example Input:

If I set the line width in 79 chars:

signal user_start_write, user_start_read, user_fin_read, user_fin_write, user_read_mismatch, byte_high, command : std_logic;

Example Output:

signal user_start_write, user_start_read, user_fin_read, user_fin_write,
       user_read_mismatch, byte_high, command : std_logic;

Or maybe:

signal user_start_write, user_start_read, user_fin_read,
            user_fin_write, user_read_mismatch, byte_high, command : std_logic;
g2384 commented 3 years ago

Thanks for the suggestion. It's quite hard to implement and will introduce bugs since I don't know all the cases. The one you showed above is one of many possible cases. What long sentences should be wrapped.?

grigosback commented 3 years ago

The main cases that come to my mind now are long signal declarations and constant declarations