cross referencing resource contents of another language [message #843504] |
Fri, 13 April 2012 05:11 |
|
I have two "split" grammars created separately into their own projects. The grammars are summarized as follows:
Foo: extends XType
...
ComponentType:
'componentType' name = ID
('configuration' configuration = JvmTypeReference)?
;
;
Bar: extends XBase
...
import "..company.com/foo/Foo" as foo
...
Component:
{Component}
type=[foo::ComponentType|QualifiedName]
name=ValidID
;
...
;
I overrode default ImportUriGlobalScopeProvider as follows:
protected LinkedHashSet<URI> getImportedUris(Resource resource) {
LinkedHashSet<URI> temp = super.getImportedUris(resource); temp.add(URI.createURI("platform:/plugin/path/to/foo/file/cxf.foo"));
return temp;
}
When I have both .foo and .bar files in the same workspace, it is able to locate ComponentType as well as the Configuration of the ComponentType.
However, when the .foo file is in parent workspace, or deployed in dropins folder, then it can find the ComponentType but navigating to ComponentType.configuration results in JvmVoid as opposed to JvmGenericType.
I suspect this is happening since FooScopeProvider is not delegating to BarScopeProvider. I appreciate any feedback as I am debugging into how to best do this...
Best regards,
Kagan
|
|
|
|
Re: cross referencing resource contents of another language [message #851839 is a reply to message #845653] |
Sat, 21 April 2012 11:16 |
|
Thanks Jan for your feedback. I had a separate chat with Sebastian who pointed out that this is basically a classpath issue. He suggested creating a smarter IJvmTypeProvider which can implicitly add the projects that have the .foo files which contains the ComponentTypes into the classpath.
For a quick test, if I explicitly set the classpath, the validation errors on locating the ComponentType.configuration dissapeared.
IJvmTypeProvider has two concrete implementations: It seems I have to override both ClasspathTypeProvider used in pure runtime, and JdtTypeProvider
[Updated on: Sun, 22 April 2012 01:19] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02053 seconds