Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » ImportURI is depricated?
ImportURI is depricated? [message #1782051] Fri, 16 February 2018 13:37 Go to next message
Timur Musaev is currently offline Timur MusaevFriend
Messages: 1
Registered: February 2018
Junior Member
Hello Everyone. I am new in Xtext and i have a question regarding ImroptURI attribute. Is it still valid to use? Or there are other alternatives for it? Because in current Xtext documentation it`s not mentioned at all.
Thanks in advance
Re: ImportURI is depricated? [message #1782236 is a reply to message #1782051] Tue, 20 February 2018 19:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

its not deprecated but kind of discouraged. see https://www.eclipse.org/forums/index.php/m/1736352/?srch=ImportUriGlobalScopeProvider#msg_1736352

alternatives is
- use it anyway
- use name based scoping
- mimic uri based scoping with names (depends on how your uris work and how and if you work with different folders, relative vs absolute uris etc.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: ImportURI is depricated? [message #1782242 is a reply to message #1782051] Tue, 20 February 2018 19:58 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Depends on your language. If you *have* to design with a strong include mechanism, then importURI is still a useful choice. If you design a new language consider a namespace based language better. Strongly discouraged are transitive imports.
Re: ImportURI is depricated? [message #1782280 is a reply to message #1782242] Wed, 21 February 2018 09:10 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Sorry. I'm old fashioned. I think a strong include is a very desirable property. Your code actually then does something vaguely understandable. Without it, all references require an expensively recomputed magic global index of everything that might possibly be useful to come up with a possibly surprising solution, particularly when you have too many debug test programs with similar declarations. MWE2 is an excellent example whereby invocation of an explicit MWE2 script loaded it to discover its name, then searched an index to execute a potentially different script with the 'same' name.

Regards

Ed Willink
Previous Topic:Cross referencing in xtext
Next Topic:Allow negative unary expression in combination with subtraction
Goto Forum:
  


Current Time: Tue Apr 23 12:02:21 GMT 2024

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

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

Back to the top