Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext] Need help with implicit imports
[Xtext] Need help with implicit imports [message #1398635] Fri, 11 July 2014 10:50 Go to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 144
Registered: July 2009
Location: Canada
Senior Member
I am trying to get implicit imports working in my project [0]. The models [1] to be implicitly imported are wrapped in a plugin project [2]. The DSL plugins have a dependency on the plugin project (aka library project).

I have implemented the custom ImportedNamespaceAwareLocalScopeProvide [3]. Also, configured the same in the runtime module [4].

When I deploy/launch all my plugins (dsl + library), I assume the models (from the library) should show up in the content assist. However, that doesn't seem to happen.

Can someone please take a look at my code. Perhaps I might be doing something wrong. I went through a couple of threads related to implicit imports, however I have had no luck so far. Would be great if someone could help.

[0] https://github.com/nbhusare/Xtext-sandbox
[1] https://github.com/nbhusare/Xtext-sandbox/tree/master/org.neclipse.models/resources/org/neclipse/models
[2] https://github.com/nbhusare/Xtext-sandbox/tree/master/org.neclipse.models
[3]
https://github.com/nbhusare/Xtext-sandbox/blob/master/org.neclipse.xtext.functiondsl/src/org/neclipse/xtext/functiondsl/scoping/FunctionImportedNamespaceAwareLocalScopeProvider.java

https://github.com/nbhusare/Xtext-sandbox/blob/master/org.neclipse.xtext.parentdsl/src/org/neclipse/xtext/parentdsl/scoping/ParentImportedNamespaceAwareLocalScopeProvider.java
[4] https://github.com/nbhusare/Xtext-sandbox/blob/master/org.neclipse.xtext.functiondsl/src/org/neclipse/xtext/functiondsl/FunctionDslRuntimeModule.java

Thanks in advance.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Re: [Xtext] Need help with implicit imports [message #1399803 is a reply to message #1398635] Sun, 13 July 2014 07:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13271
Registered: July 2009
Senior Member
-----

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sun, 13 July 2014 07:33]

Report message to a moderator

Re: [Xtext] Need help with implicit imports [message #1399810 is a reply to message #1399803] Sun, 13 July 2014 07:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13271
Registered: July 2009
Senior Member
you need a dependency from the project containing the .yourdsl files to the libary project.
it does not help to put the dependency to the .dsl or .dsl.ui project

i am not sure what to do if you want to have the dependency to the libary project implicit as well.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sun, 13 July 2014 07:34]

Report message to a moderator

Re: [Xtext] Need help with implicit imports [message #1400564 is a reply to message #1399810] Mon, 14 July 2014 11:48 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3104
Registered: July 2009
Senior Member
Hi,

there are ways to achieve the desired behavior. What you could try to do
is to use a the bundle reference to the lib and resolve known classpath
URIs against that bundle. The resolved instances can be made available
in your scope provider and in your content assist implementation. In
general it is a better idea to make the library available on the user
side by means of explicit project dependencies as Christian already
pointed out.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 13.07.14 09:12, schrieb Christian Dietrich:
> you need a dependency from the project containing the .yourdsl files to
> the libary project.
> it does not help to put the dependency to the .dsl or .dsl.ui project
Previous Topic:Xtext resource in MWE2
Next Topic:Error after Xtext Utils add
Goto Forum:
  


Current Time: Thu Dec 12 07:53:18 GMT 2019

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

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

Back to the top