Hi
The folding mechanism gets confused by an
instance of a component if the optional keyword "component" is written before the name of the
component to instantiate.
1 architecture rtl of test is
2 component ff is
3 generic(
4 width : natural);
5 port(
6 d : in std_logic_vector;
7 q : out std_logic_vector
8 );
9 end component ff;
10 begin
11 instance : component ff
12 -- ^^^^^^^^^ is optional
13 generic map(
14 width => 8
15 )
16 port map(
17 d => d,
18 q => q
19 );
20
21 end architecture rtl;
when you fold the code on line 11 then the lines 11 to 21 will be folded.
If you remove the word "component" the folding will not be possible for the whole instance (generic map + port map).
regards daniel
danselmi at gmx.net
Logged In: YES
user_id=12579
Originator: NO
Since language support is the responsibility of those that use the language I won't be working on this.
patch to correctly fold instances
The added code declares new variables ch and style which shadow earlier declarations with the same names. It is better to use distinct names since that is less confusing for readers and avoids warnings from some compilers. The next section dealing with "procedure" and "function" is similar but uses distinct names although LocalStyle and LocalCh are a bit ugly.
There is also shadowing of the variable "j" but that wasn't introduced by this patch. If you have time, it would be good to change the different variables currently called "j" to have distinct names.
{ch, style, j , LocalCh, LocalStyle} renamed to {chAtPos, styleAtPos, pos, chAtPos, styleAtPos}
see attached patch.
Committed as [859371].
Related
Commit: [859371]
I think it's worth mentioning that this patch also fixes the issue with VHDL'93-style
entity
instantiations:(I was about to report a bug about this, before realizing that this patch also fixed it)
There is a bug introduced by this change. Typing the keyword "entity" at the start of a file causes Scintilla to hang due to an unsigned pos (line 393) going less than 0 so very large.
Fix committed as [057257].
Related
Commit: [057257]