Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extending existing files with Xtend
Extending existing files with Xtend [message #1689355] Mon, 23 March 2015 11:41 Go to next message
Ferdinand von den Eichen is currently offline Ferdinand von den EichenFriend
Messages: 9
Registered: March 2015
Junior Member
Hi everyone,

I basically want to modify classes of an already existing project. I would have to insert a number of lines of code at certain points in the existing files.

1) What's a good approach, design-wise? Are there any reference implementations I could look at? Currently I'm thinking to have markers in the files that indicate where I can safely insert code.

2) In terms of implementation: The IFileSystemAccess of the overwritten doGenerate seems basic at best (only create & delete file). What is a good/more powerful way of accessing and modifying files in Xtend?

Greetings & thanks for bearing with me! Smile

Ferdinand
Re: Extending existing files with Xtend [message #1690079 is a reply to message #1689355] Wed, 25 March 2015 06:51 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
There are three extensions, available since version 2.4, with additional capabilities which you can cast to:
- IFileSystemAccessExtension
- IFileSystemAccessExtension2
- IFileSystemAccessExtension3

Sorry, for the inconvenient API in this place.
hth,
Sven

[Updated on: Wed, 25 March 2015 06:52]

Report message to a moderator

Re: Extending existing files with Xtend [message #1690145 is a reply to message #1690079] Wed, 25 March 2015 13:29 Go to previous message
Ferdinand von den Eichen is currently offline Ferdinand von den EichenFriend
Messages: 9
Registered: March 2015
Junior Member
Thanks for the info! I think these three extension have pretty much solved my issues. I'm now running a setup where i tag lines of codes in generated files with custom markers. I can then edit/insert or remove lines at the marker locations by using the extensions you mentioned! Smile
Previous Topic:[Xbase] Configuring scoping when extending Xbase for use of variables and expressions
Next Topic:Got imported model problem after transition from Xtext 2.7.3 to Xtext 2.8.0
Goto Forum:
  


Current Time: Mon Apr 19 11:47:57 GMT 2021

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

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

Back to the top