|Comments broke Indentation in formatted code [message #1130078]
||Wed, 09 October 2013 08:01
| Petr Fuks
Registered: October 2013
I have problem with formatting code with comments. I tried to use setLinewrap(min,default,max) method from org.eclipse.xtext.formatting.impl.FormattingConfig class, but this method broke indentation on line after the comment (set indentation to zero)
c.setLinewrap(0, 1, 2).after(f.getSL_COMMENTRule());
c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
When I used method setLinewrap(1) it makes two line breaks so there is one free line after each comment. Interesting is when I used setLinewrap(1) after other keyword (e.g. semicolon)it makes only one line break.
Does anyone know how to correctly formatted lines with comments?
Powered by FUDForum
. Page generated in 0.01861 seconds