Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Same keywords xtext formatter
Same keywords xtext formatter [message #1851577] Fri, 08 April 2022 15:09 Go to next message
Eclipse UserFriend
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 01:25 Go to previous message
Eclipse UserFriend
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
Previous Topic:Storing list of eobjects before calling xtext validations
Next Topic:Xtext 2.27.0.M1 is out
Goto Forum:
  


Current Time: Sat Jul 05 11:12:14 EDT 2025

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

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

Back to the top