|Model inferrer issue during file access [message #1387554]
||Wed, 25 June 2014 08:45
| Zoltan Ujhelyi
Registered: July 2015
the EMF-IncQuery project got a request (https://bugs.eclipse.org/bugs/show_bug.cgi?id=437942) 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,
Powered by FUDForum
. Page generated in 0.01178 seconds