Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Same keywords xtext formatter
Same keywords xtext formatter [message #1851577] Fri, 08 April 2022 19:09 Go to next message
John Henbergs is currently offline John HenbergsFriend
Messages: 214
Registered: October 2020
Senior Member
Hello,

I am trying to format a DSL, however I am having an issue. Consider I have the following:

Root:
'Element A' '{ ' ...... '}'
'Element B' '{ ' ...... '}'
'Element C' '{ ' ...... '}'
...
;


Now I want to do something with the third opening bracket after Element C. However, when I do,
 root.regionFor.keyword('{').append[newLine]

The formatting happens to the first opening bracket in Element A.
Is there a way to access directly the third one?

Thanks!
Re: Same keywords xtext formatter [message #1851583 is a reply to message #1851577] Sat, 09 April 2022 05:25 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
doesnt the regionFor.keywords(",") return a list?
you also can take a look at grammarAccess and the regionFor method that takes grammar elements as parameters


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Storing list of eobjects before calling xtext validations
Next Topic:Xtext 2.27.0.M1 is out
Goto Forum:
  


Current Time: Sun Sep 25 08:26:50 GMT 2022

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

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

Back to the top