Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to change Xtext DSL file programmatically ? (Xtext 2.24)
How to change Xtext DSL file programmatically ? (Xtext 2.24) [message #1841843] Tue, 01 June 2021 06:45 Go to next message
Ryana Karaki is currently offline Ryana KarakiFriend
Messages: 19
Registered: May 2021
Junior Member
Hello,


I am new to Xtext & DSL writing. Following Xtext tutorials, I created a DSL and want to add debugging support such as breakpoints, detailed messages...

To add messages dynamically, I want to be able to edit my Xtext DSL file programmatically : for instance, if I pass through a certain variable, I want it to change its writing style to italic.

I saw this thread https://www.eclipse.org/forums/index.php/m/552850/?srch=getActiveXtextEditor+returns+null#msg_552850, and discovered that the IDocumentEditor could help me. However, working in Xtext 2.24, it seems that I can't access it.

Does a 'replacement' for the IDocumentEditor exist or am I missing something ?


Thanks in advance !
Re: How to change Xtext DSL file programmatically ? (Xtext 2.24) [message #1841861 is a reply to message #1841843] Tue, 01 June 2021 12:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi

IXtextDocument is a IWriteAccess
this you can call modify on editor.getDocument()


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to change Xtext DSL file programmatically ? (Xtext 2.24) [message #1841891 is a reply to message #1841861] Wed, 02 June 2021 12:39 Go to previous message
Ryana Karaki is currently offline Ryana KarakiFriend
Messages: 19
Registered: May 2021
Junior Member
Thank you for your help ! I managed to edit my file.
Previous Topic:Making editor regions read-only
Next Topic:Integrate ocl in xtext grammar or grab all the characters until any language rule appears
Goto Forum:
  


Current Time: Thu Apr 25 03:57:50 GMT 2024

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

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

Back to the top