Unexpected Result When Using the Align Action
The Edit -> Align command does not seem to work as expected for generic declarations with default values. Specifically, only the last sets of colons are aligned:
Before:
entity my_entity is generic ( w : natural := 0; xx : std_logic := '1'; yyy : std_logic_vector(3 downto 0) := x"C"; zzzz : unsigned(2 downto 0) := o"5" ); port ( x : in std_logic; yy : in std_logic_vector(1 downto 0); zzz : out signed(7 downto 0) ); end my_entity;
After (with default values):
entity my_entity is generic ( w : natural := 0; xx : std_logic := '1'; yyy : std_logic_vector(3 downto 0) := x"C"; zzzz : unsigned(2 downto 0) := o"5" ); port ( x : in std_logic; yy : in std_logic_vector(1 downto 0); zzz : out signed(7 downto 0) ); end my_entity;
After (without default values):
entity my_entity is generic ( w : natural; xx : std_logic; yyy : std_logic_vector(3 downto 0); zzzz : unsigned(2 downto 0) ); port ( x : in std_logic; yy : in std_logic_vector(1 downto 0); zzz : out signed(7 downto 0) ); end my_entity;
Expected result:
entity my_entity is generic ( w : natural := 0; xx : std_logic := '1'; yyy : std_logic_vector(3 downto 0) := x"C"; zzzz : unsigned(2 downto 0) := o"5" ); port ( x : in std_logic; yy : in std_logic_vector(1 downto 0); zzz : out signed(7 downto 0) ); end my_entity;
Also, even after the alignment is manually corrected, it is not maintained when the component declaration template is invoked:
component my_entity generic (w : natural := 0; xx : std_logic := '1'; yyy : std_logic_vector (3 downto 0) := x"C"; zzzz : unsigned (2 downto 0) := o"5"); port (x : in std_logic; yy : in std_logic_vector (1 downto 0); zzz : out signed (7 downto 0)); end component my_entity;
- Forums:
There seems to be a problem
There seems to be a problem with this relatively new feature when multiple columns should be aligned.
I have logged this as ticket: 568.
fixed
This will be fixed in the upcoming release (was ticket:568, ticket:586)
Philippe
Align doesn't seem to work
OK, what am I missing? I can't seem to get Align to do anything. I also can't find any reference to it in the help, other than the keyboard shortcut.
I've tried selecting the text, then align from the right-click popup, the edit menu, and the keyboard shortcut. Non of which do anything. The file is marked as dirty, but I see no changes. I've tried not selecting text, but placing the cursor in various places in the code (within if statements, port declarations, etc) and still no changes. What am I doing wrong? Also, an entry in the help would be a really good thing.
Current build (Mac OSX):
Sigasi® HDT 1.0.0.20091222082046 com.sigasi.hdt.rcp.product
correct selection for align
Hi Tim,
I'll make sure we add this to our documentation.
The align action only works when at least one of the following symbols is contained in each line in your selection:
This is the case when you select a bunch of declarations or a port map.
I've made a note that the file should not be marked as dirty when nothing happens (ticket:700). I'm not sure if we should pop up a dialog with an error message when the selection cannot be aligned?
Philippe
fixed ticket:700
Ticket:700 was fixed internally and will be released next week; File should not be marked as dirty when align action has no effect.
selection for Align
Philippe,
Thanks for the update. My problem isn't as much with the file being marked as dirty when nothing changes, but rather that nothing changes.
Example:
When I select the entirety of the text above, and select align from the contextual menu, nothing happens to the text. In fact the above is the result align command.
A brief popoup (like you have for the keyboard shortcut reminders) would be good this, and other things like it fail.
Also, Is there any documentation on Align?
thanks,
Tim.
selection for Align
OK, I should have previewed the above post before saving it. The white space between the registers and the assignment didn't make it through the posting.
Here's what it should look like:
cannot reproduce
Hi Tim,
I've tried to align this snipped and it works perfectly on my machine. You do have the most recent build, so I'm not sure what went wrong.
We'll write and publish documentation on the align feature as soon as possible.
Can you send me the log so that I can investigate further?
thanks
Philippe
Log File Sent
Philippe,
I've sent the log file. Let me know if you need anything further.
-Tim.
Align still doesn't work with latest update
I am still unable to use Align in any way. Nothing happens. Zip. Nada.
video
Hi Tim,
We cannot reproduce your problem. Perhaps our interface is not intuitive and you use it different from what we expect.
I've posted a video on how to use Align. http://www.sigasi.com/content/vertical-align
Can I call/skype you about this?
Figured it out, still a bug
Phillipe,
Thanks for the video, it showed me the difference of what I was doing Vs. what you expect.
What was tripping me up is the fact that align doesn't work if there are lines without any of the key symbols. I consider this a bug. If there are no symbols that get aligned within the line, just skip it and go to the next. Also there should be some reporting as to why the command failed. From a user perspective, there's nothing worse than a silent failure.
Thanks,
-Tim
glad it works
Hi Tim. Glad it works now. You're right about the silent failure thing. We'll look for an elegant solution.
Philippe
update
In the next release, we will gracefully ignore white lines and commented lines. Code blocks like this will align nicely:
Philippe
Excellent
Excellent! I'm eagerly awaiting the update.
Thanks,
-Tim.
The update rocks!
Philippe,
I just updated HDT, and align behaves exactly as I expect! Thanks for the quick turn-around on the fix!
-Tim
You're welcome
Hi Tim, I'm glad you like it. It's really user requests that improve a product!
Philippe
Post new comment