Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Comments broke Indentation in formatted code(Comments broke Indentation in formatted code)
Comments broke Indentation in formatted code [message #1130078] Wed, 09 October 2013 08:01 Go to next message
Petr Fuks is currently offline Petr FuksFriend
Messages: 1
Registered: October 2013
Junior Member
Hi,

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?

Regards, Petr
Re: Comments broke Indentation in formatted code [message #1258735 is a reply to message #1130078] Thu, 27 February 2014 17:57 Go to previous message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 62
Registered: July 2009
Member
UDP: My issue looked similar, but I think it's a different issue.
I created another topic for this - http://www.eclipse.org/forums/index.php/m/1258736/#msg_1258736

[Updated on: Thu, 27 February 2014 18:00]

Report message to a moderator

Previous Topic:Error injecting method [Xtext project on Tomcat]
Next Topic:Adding invalid references in Xtext
Goto Forum:
  


Current Time: Fri Apr 19 04:31:10 GMT 2024

Powered by FUDForum. Page generated in 0.02133 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top