Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » cross-file references does not work after update (missing .classpath file)
cross-file references does not work after update (missing .classpath file) [message #1046650] Mon, 22 April 2013 07:31 Go to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
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 #1046904 is a reply to message #1046650] Mon, 22 April 2013 14:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6550
Registered: July 2009
Senior Member
HI,

i cannot reproduce that. did you any customizations?

~Christian
Re: cross-file references does not work after update (missing .classpath file) [message #1047730 is a reply to message #1046904] Tue, 23 April 2013 15:13 Go to previous message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hi Christian,
I will describe exact steps how to reproduce this:


  1. Create new Xtext project
  2. Adjust the grammar:
    Model:
    	greetings+=(Greeting|Response)*;
    	
    Greeting:
    	'Hello' name=ID '!';
    
    Response:
    	'Response' greeting=[Greeting]
    ;
    

  3. Adjust mwe2 file:
        fragment = projectWizard.SimpleProjectWizardFragment auto-inject {
              generatorProjectName = "${projectName}"
              fileExtension = fileExtensions
              pluginProject = false
        }
    

  4. Run Eclipse Application
  5. Create new "MyDsl project"
  6. Create there 2 model files: a.mydsl and b.mydsl
    a.mydsl:
     Hello Xtext! 

    b.mydsl:
     Response Xtext 




  • 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
Previous Topic:AudoEditStrategy with context?
Next Topic:unique name validation in project, not the whole workspace
Goto Forum:
  


Current Time: Sun Dec 21 15:10:33 GMT 2014

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

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