Lining up arguments vertically [message #1702470] |
Wed, 22 July 2015 10:21  |
Eclipse User |
|
|
|
Hi,
In my dsl i want that '|' is aligned vertically. But in the grammar an Identifier is coming before '|' and length of identifier is not fixed. I want that in pretty formatting all the '|' should be aligned vertically. not like this:
writeon | --> dpr_writeon_p1;
pass | --> lpr_pass_p2;
penalty | --> d1_penalty_apb_slv_i1;
bdata [16] | --> d2_bdata[16];
opdata [1080] | --> d1_opdata[1080];
but something like this:
writeon | --> dpr_writeon_p1;
pass | --> lpr_pass_p2;
penalty | --> d1_penalty_apb_slv_i1;
bdata [16] | --> d2_bdata[16];
opdata [1080] | --> d1_opdata[1080];
In MyDslFormatter.xtend, what I am doing is:
for(Keyword p : g.findKeywords('|'){
c.setSpace(' \t\t').around(p)
}
but if the difference in the length of identifiers is greater than 3 this approach is not working.
I guess this is because tab indent only 4 units.
what should I do?
or is there any way that I can fix the position of '|'?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07830 seconds