Indent after first line [message #1732738] |
Thu, 19 May 2016 11:48 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Maged Elaasar![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=melaasar%40gmail.com) Messages: 23 Registered: September 2013 |
Junior Member |
|
|
I am using Xtext 2.9 formatter2 API.
I am trying to figure out how to cause the formatter to produce indentation like in the following example:
In other words, I would like to insert new lines before "from" and "to" and indent them.
My current code looks like this:
def dispatch format(Relationship relationship, extension IFormattableDocument document) {
relationship.prepend[newLines = 2]
relationship.regionFor.keyword("from").prepend[newLine]
relationship.regionFor.keyword("to").prepend[newLine]
}
which adds the new lines but not the indentation. How do I modify it, to add the indentation? Thanks in advance.
[Updated on: Thu, 19 May 2016 12:16] Report message to a moderator
|
|
|
|
|
|
Re: Indent after first line [message #1732742 is a reply to message #1732741] |
Thu, 19 May 2016 19:21 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
set(relationship.regionFor.keyword("from").previousHiddenRegion, relationship.regionFor.feature(MyDslPackage.Literals.RELATIONSHIP_SOURCE).nextHiddenRegion)[indent]
set(relationship.regionFor.keyword("to").previousHiddenRegion, relationship.regionFor.feature(MyDslPackage.Literals.RELATIONSHIP_TARGET).nextHiddenRegion)[indent]
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03713 seconds