xtext formatter questions, including linewraping, keywords replacing -
i have few questions formatter of xtext. i'm dealing sql-like language.
- i'm using 3 default setlinewrap() commands comments. insert space after
sl_comment,
like
update plays set scores = scores - [ 12, 21 ] id = '123-afde'; // removes occurences of 12 , 21 scores select * mytable t = now(); become
update plays set scores = scores - [ 12, 21 ] id = '123-afde'; // removes occurences of 12 , 21 scores select * mytable t = ( ); could remove space?
- how wrap @ specific place only if line long? tried
setlinewrap(0, 1, 1)doesn't work.
for example
update table set = + 1 > 0; update tablelongna set c = c + 1 c in (1, 2, 3, 4, 4, 5, 6, 7, 0, 7, 8); become
update table set = + 1 > 0; update tablelongna set c = c + 1 c in (1, 2, 3, 4, 4, 5, 6, 7, 0, 7, 8); - i use
setlinewrap(2).after(t_semicolon);, works fine usual case. batch query
like
begin batch update ......; update ......; apply batch; next query..... i try use setlinewrap(1).before(k_apply); overwrite doesn't work. can't use setnospace() or setnolinewrap() otherwise apply batch not have it's own line.
can replace keyword upper case in formatter? ex.
select * foo;select * foo;. looks apis can manipulating whitespaces/newlines?not sure it's problem or not, can't hot swap formatter in debug mode. such have quit eclipse instance , run again see change.
Comments
Post a Comment