Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » formating with Xtend
formating with Xtend [message #1059387] Fri, 17 May 2013 21:02 Go to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi all ,

I write formating class ,below code is written with java.I want to write with Xtend.butnot defined and take an error:
findKeywordPairs and pair.getFirst(), pair.getSecond()
List<Pair<Keyword,Keyword>> pairs = f.findKeywordPairs("{", "}");
			for (Pair<Keyword, Keyword> pair : pairs) {
				c.setIndentation(pair.getFirst(), pair.getSecond());
			}



Best regards
Re: formating with Xtend [message #1059389 is a reply to message #1059387] Fri, 17 May 2013 21:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

what is your problem?

class MyDslFormatter extends AbstractDeclarativeFormatter {

	@Inject extension MyDslGrammarAccess
	
	override protected void configureFormatting(FormattingConfig c) {
		findKeywordPairs("{","}").forEach[
			c.setIndentation(first, second)
		]
	}
}



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: formating with Xtend [message #1059391 is a reply to message #1059389] Fri, 17 May 2013 21:31 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Christian,

I do not define List<Pair<Keyword,Keyword>> pairs = f.findKeywordPairs("{", "}");
I write
val List<Pair<Keyword,Keyword>> = f.findKeywordPairs("{", "}"); in the Xtend.

it will solve my problem:
findKeywordPairs("{","}").forEach[
c.setIndentation(first, second)
]

[Updated on: Fri, 17 May 2013 21:34]

Report message to a moderator

Re: formating with Xtend [message #1059392 is a reply to message #1059391] Fri, 17 May 2013 21:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
sorry dont get your point

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: formating with Xtend [message #1059394 is a reply to message #1059389] Fri, 17 May 2013 21:47 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Christian ,

I want to apply formating my program with Xtend .I want to write below format with my program.

ContentModel ct {
	ID="lll" 
	displayName = "displayName"
      WebApplication webapp{
	  ID="fff"	
	  displayName = "displayName"
	  SiteCollection sitecall {
	  	ID ="kk" 
	  	displayName ="displayName"
          }
       }
}
  

Re: formating with Xtend [message #1059395 is a reply to message #1059394] Fri, 17 May 2013 21:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
This is not what i asked: is your problem solved or not: if you use xtend you have to learn Xtend Syntax,

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: formating with Xtend [message #1059397 is a reply to message #1059395] Fri, 17 May 2013 22:05 Go to previous message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
I ask xtend syntax previouly question. I am learning Xtend Syntax so I have difficulty.
Previous Topic:The scope for name uniqueness
Next Topic:Problem with context in Xbase Interpreter
Goto Forum:
  


Current Time: Fri Apr 19 23:38:49 GMT 2024

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

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

Back to the top