Problems with Cross-Reference resolving in standalone app [message #1009137] |
Thu, 14 February 2013 09:17  |
Eclipse User |
|
|
|
Hi All,
I've got such a case.
In our project, we use xText defined language for configuration purposes.
There's a Declaration part in separate file (i.e. declaration.mydsl) and a bunch of configuration files (one for every instance of our app - so, *.mydsl) tied with declaration by import clause (Import platform:/resource/xxx/declaration.mydsl )
So far it was used only in Eclipse environment in a traditional way (editor stuff, eclipse plugins stuff and so on).
Now, my task is to gather all separate config files via standalone java app (.jar file with arguments configured in CI) and print out a report or so.
The problem I've encountered is that when I iterate through the elements of config files, the names and values defined in declaration file are not being resolved (I'm getting nulls).
Now that is quite obvious, because platform: URI pattern is not available outside Eclipse-Env.
When I've changed import clause to Import file:/hardcoded/path/to/declaration.mydsl it is working fine.
Ok, so finally to the point. My question is, how can I make it work in both worlds (Standalone vs. Eclipse) not to break resolving mechanism in any?
I've read quite a few posts on the forum, but any gave my good direction.
I've also read an article about "Xtext cross references and scoping" on itemis blog, but unfortunately that gave me more doubts. I'm rather example or step-by-step-case type of guy.
Regards,
Marcin
PS. I hope that above makes sense, please let me know when more info would be needed.
|
|
|
|
|
|
|
|
|
|
Re: Problems with Cross-Reference resolving in standalone app [message #1010813 is a reply to message #1009672] |
Mon, 18 February 2013 04:31  |
Eclipse User |
|
|
|
Unfortunately, I'm not allowed to share client code, but guess I've found the solution for me, so I'll share that.
What worked for me is that I've changed:
new StandaloneSetup().setPlatformUri(myPath);
to
Mapping uriMap = new Mapping();
uriMap.setFrom("platform:/resource/");
uriMap.setTo(myPath));
new StandaloneSetup().addUriMap(uriMap);
and for now it works fine.
Thank for help and good directions.
Regards,
Marcin
|
|
|
Powered by
FUDForum. Page generated in 0.08292 seconds