Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Model inferrer issue during file access
Model inferrer issue during file access [message #1387554] Wed, 25 June 2014 08:45
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 373
Registered: July 2015
Senior Member
Hi all,

the EMF-IncQuery project got a request ( that it was not possible to load its model files when the Xtext-based editor was loaded and the file was not added to the source folder of a Java project in the workspace. However, the same file could be loaded using the headless version of the language parser.

Some experimentation showed that the culprit was the model inferrer that tried to access the java.lang.Override annotation, but could not, because the UI project of our language has bound JdtTypeProviderFactory for type access, that does not handle the forementioned cases where the files are not in a Java project (more specifically, it contains a related todo comment: "TODO throw a serious exception instead of returning a non working implementation"

I (hope I) was able to work around the issue in EMF-IncQuery by creating a dispatcher type provider that uses JdtTypeProviderFactory only if the eiq file is in a Java project, otherwise it falls back to the ClasspathTypeProvider.

My question is twofolds:
1. Is this kind of workaround functionally correct? Do I have to expect issue with regards to parsing files, or something that is already planned in Xtext?
2. If the workaround is functionally correct, wouldn't it be better to implement JdtTypeProviderFactory to fall back to the ClasspathTypeProviderFactory if it cannot be done? In this case I would be glad to provide a solution that works this way.

Thanks for your time,
Previous Topic:Generating a language without preference pages
Next Topic:Settings two attributes when consuming one token
Goto Forum:

Current Time: Sun Aug 09 14:32:17 GMT 2020

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

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

Back to the top