Feature Request -- Comments

Hello,

at the moment i test sigasi 2.0. In sigasi 2.0 you have now the format command instead of the align command in sigasi 1.0. I had already posted this feature request in a former post, but for a better readability of the code i place my comments as followed:

if (s_startup_done = '0') then                                    -- set status
   for i in 0 to c_61e0_number_of_channels-1 loop
      s_o_6152_status_word(i)(c_status_ipv_invalid)  <= '1';      -- ipv is invalid
      s_o_6152_status_word(i)(c_status_reset_active) <= '1';      -- reset is set
   end loop;
elsif(s_startup_done = '1' and s_startup_done_p1 = '0') then      -- with rising edge of startup done
   for i in 0 to c_61e0_number_of_channels-1 loop
      s_o_6152_status_word(i)(c_status_ipv_invalid)  <= '0';      -- clear ipv invalid
      s_o_6152_status_word(i)(c_status_reset_active) <= '0';      -- clear reset
   end loop;
end if;

Now, when I use the format command the comments are placed directly behind the code

if(s_startup_done = '0') then     -- when init of device is not finished set ipv status word
   for i in 0 to c_61e0_number_of_channels – 1 loop
      s_o_6152_status_word(i)(c_status_ipv_invalid) <= '1'; -- ipv is invalid
      s_o_6152_status_word(i)(c_status_reset_active) <= '1'; -- reset is set
   end loop;
elsif(s_startup_done = '1' and s_startup_done_p1 = '0') then -- with rising edge of startup done for i in 0 to c_61e0_number_of_channels – 1 loop s_o_6152_status_word(i)(c_status_ipv_invalid) <= '0'; -- clear ipv invalid s_o_6152_status_word(i)(c_status_reset_active) <= '0'; -- clear reset end loop;
end if;

Maybe you could implement that the comments will be placed at column position XX (the position could be defined anywhere), and if the written code is longer than position XX the comment is directly placed after the last character with one whitespace between.

Bernd

We already do this

Currently you can't change this value, it is always set to 40.

Making the formatter configurable will happen, but currently it isn't planned.
I've logged this as ticket:1945

state of affiars

Hi,
i want to give this feature a higher priority.
Do you think it is possible to realize the variable comment position?

Bernd

next version

I'll try to get this into the next release. It will be a hidden preference, I'll send you an email once the next version is released.

Comments starting at line xx

Why not :

- when you process a line and see there is a comment at the end, remember the comment position

- reformat the line

- put the comment back at the same position

- if the line would have become larger (e.g. because spaces are added), just add the comment at the end of the line

I often indent my comments, to differentiate between parts of the code (e.g. at index 70 for a state of a state machine, and index 80 for code of that state).

Post new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.