简体   繁体   中英

Xtext cross-references work only with an Xtext Java Project?

I followed this tutorial Second Iteration: Adding Packages and Imports by Xtext . I was trying to make a cross reference like the one shown in the last picture of the tutorial, that I paste here: Xtext教程

In first example of the tutorial page I had simply to create a java project and a file mymodel.dmodel and everything works fine.

I noticed that in second example (named Second Iteration: Adding Packages and Imports ) the cross-references don't work (I have some Could'nt resolve reference errors) with a simple java project. However it works fine if I convert the project to an Xtext project .

Is this a normal behaviour or have I missed some configuration steps?

To get the cross references work you need

  1. A project with xtext nature + builder (that is what convert to xtext project does, this is an "add xtext" not a "remove java" operation
  2. Build automatically should be enabled
  3. Depending on the project type
    1. Java Project: Put the files in a source folder
    2. Non Java (General -> Project): Put the files anywhere

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM