cross-file references does not work after update (missing .classpath file) [message #1046650] |
Mon, 22 April 2013 03:31  |
Eclipse User |
|
|
|
Hello,
I just updated my Eclipse and Xtext to new stable version (Xtext 2.4.1) and everything works fine except the references to other files.
Assume having following grammar:
Model:
greetings+=(Greeting|Response)*;
Greeting:
'Hello' name=ID '!';
Response:
'Response' greeting=Greeting;
Having 2 model files: a.mydsl and b.mydsl, where a.mydsl contains Greeting and b.mydsl contains Response to it.
- It works out of the box, when Java Project is created for this purpose.
- It does not work, when project wizard created using SimpleProjectWizardFragment is used. It works only if Greeting and Response are in the same file. I found out, that if I add just simple .classpath file to project, than it works for this project as well:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>
I override generated wizard classes to create this file and it works for new projects as expected. Problem is with old projects. When users update to new version, they will have to add .classpath file manually (as it was not necessary to have .classpath file in projects before).
Questions are: Why is it necessary to have this file in project now? Is it possible to do it somehow without mentioned file? Is there some simple way to add .classpath file automatically to old projects?
Thank you & Best regards
Michal Sroka
|
|
|
|
Re: cross-file references does not work after update (missing .classpath file) [message #1047730 is a reply to message #1046904] |
Tue, 23 April 2013 11:13  |
Eclipse User |
|
|
|
Hi Christian,
I will describe exact steps how to reproduce this:
- Create new Xtext project
- Adjust the grammar:
Model:
greetings+=(Greeting|Response)*;
Greeting:
'Hello' name=ID '!';
Response:
'Response' greeting=[Greeting]
;
- Adjust mwe2 file:
fragment = projectWizard.SimpleProjectWizardFragment auto-inject {
generatorProjectName = "${projectName}"
fileExtension = fileExtensions
pluginProject = false
}
- Run Eclipse Application
- Create new "MyDsl project"
- Create there 2 model files: a.mydsl and b.mydsl
a.mydsl:
b.mydsl:
- If you take these steps in Eclipse 4.2.2 and Xtext 2.4.1 than the reference in b.mydsl to a.mydsl will be not valid. (Solution: create manualy .classpath file in runtime project or set pluginProject=true in mwe2 file, which creats .classpath file)
- If you take these steps in Eclipse 4.2.0 and Xtext 2.3.1 than the reference in b.mydsl to a.mydsl will be valid. (Even without .classpath file in the runtime project). It works without .classpath file in older versions of Eclipse and Xtext as well.
Problem: there are many projects by many users created without .classpath file already, if users update to new version of my DSL and Eclipse, all their cross-file references will be invalid and they will have to add .classpath file to every project.
Question: why cross-file references in 2.3.1 worked without .classpath file and they do not work in 2.4.1? Is it not possible to make the project valid without this file?
Regards,
Michal
|
|
|
Powered by
FUDForum. Page generated in 0.06085 seconds