Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Syntax Error in lambda implementing Xtext quickfixes
Syntax Error in lambda implementing Xtext quickfixes [message #1790980] Wed, 20 June 2018 22:40 Go to next message
Jonathan Gossage is currently offline Jonathan GossageFriend
Messages: 60
Registered: March 2010
Location: San Miguel de Allende, Gt...
Member
I am new to `Xtend/Xtext and am attempting to learn using the book Implementing Domain Specific Languages with Xtext and Xtend .The code shown below comes from Chapter 4, section Quickfixes for default validators.

I am using Xtext 2.14 on Eclipse Oxygen 3A running on up to date Windows 10 Insider Preview.

The attached image shows the problem. Xtend is complaining about the closing parenthesis in line 67, however it is needed to balance the opening parenthesis on the same line. Furthermore when I attempt to display matching parentheses, the closing parenthesis on Line 68 is shown as matching the opening parenthesis on line 57 instead of the opening parenthesis on line 65 which is the correct match.

If I remove the closing parenthesis on line 67 the code compiles successfully and I can run it successfully.

I tried, and failed, to produce a simpler test case but all my attempts worked successfully. Is this a problem I am unable to see or is this a bug?

[Updated on: Thu, 21 June 2018 00:29]

Report message to a moderator

Re: Syntax Error in lambda implementing Xtext quickfixes [message #1790984 is a reply to message #1790980] Thu, 21 June 2018 04:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12229
Registered: July 2009
Senior Member
Hi can you please post the code here.
Counting parens in a screenshot is pita
here is a working greeting example

	@Fix(MyDslValidator.INVALID_NAME)
	def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) {
		acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png', [
			element, context |
			val currentGreeting = element as Greeting
			val model = element.eContainer as Model
			model.greetings.add(model.greetings.indexOf(currentGreeting)+1,MyDslFactory.eINSTANCE.createGreeting=>[
				name = currentGreeting.name.toFirstUpper
			])
		])
	}


did you try to open and close the editor?


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 21 June 2018 04:29]

Report message to a moderator

Previous Topic:OneOf
Next Topic:XtextLinkingDiagnostic Error while loading xtext model
Goto Forum:
  


Current Time: Thu Sep 20 08:23:07 GMT 2018

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

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

Back to the top