Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [Xtext] Need help with implicit imports
[Xtext] Need help with implicit imports [message #1398635] Fri, 11 July 2014 06:50 Go to next message
Eclipse UserFriend
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.
Re: [Xtext] Need help with implicit imports [message #1399803 is a reply to message #1398635] Sun, 13 July 2014 03:02 Go to previous messageGo to next message
Eclipse UserFriend
-----

[Updated on: Sun, 13 July 2014 03:33] by Moderator

Re: [Xtext] Need help with implicit imports [message #1399810 is a reply to message #1399803] Sun, 13 July 2014 03:12 Go to previous messageGo to next message
Eclipse UserFriend
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.

[Updated on: Sun, 13 July 2014 03:34] by Moderator

Re: [Xtext] Need help with implicit imports [message #1400564 is a reply to message #1399810] Mon, 14 July 2014 07:48 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 21:56:15 EDT 2025

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

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

Back to the top