Michael Speen Messages: 2 Registered: September 2013
Junior Member
Hi,
I have problem with formatter. It places line breaks where it should not be. I haven't defined any new lines in my xtext definition file or in my formatter class.
my unformated code is:
set instance servicename
public total=count this uses-redundant Service OTHER
public up=count this uses-redundant Service OTHER with OTHER.working
and after I auto-format it, it adds line break like this:
set instance servicename
public total = count this uses-redundant Service OTHER
public up = count this uses-redundant Service OTHER with
OTHER . working
I've tried to add something like c.setNoLinewrap().after("with");
And the result is:
set instance servicename
public total = count this uses-redundant Service OTHER
public up = count this uses-redundant Service OTHER with OTHER
. working
Moritz Eysholdt Messages: 138 Registered: July 2009 Location: Kiel, Germany
Senior Member
it looks like org.eclipse.xtext.formatting.impl.FormattingConfig.setAutoLinewrap(int) has somehow been set to a lower value than 500. Your observation that suppressing the line wrap at one location postpones it to after the token indicates it's an autolinewrap.
Michael Speen Messages: 2 Registered: September 2013
Junior Member
Thanks for replying. Im sure that I have autolinewrap setted for 500, because i have several longer lines than this one.
Same probbem occured in another part of my code where I have two same functions (attribute definitions). First is ok without any line breaks but the second one is inside of IF statement with added line break..
I have no idea why is there a line break at line 3/4. As i said abowe - I have no libebreak defined in my *.xtext or formatter class.
Code before autoformatting:
public var="global" with looping
IF true THAN
public var="global" with looping
END
Code afterautoformatting:
public var = "global" with looping
IF true THEN
public var =
"global" with looping
END