1
votes
  1. I just created project based on xtext examples project "domainmodel".
  2. Generated xtext artifacts from xtext file
  3. Started eclipse application with plugins loaded
  4. Created test project and then created test.dmodel file in it
  5. I put inside code from documentation. Exactly this and only this:

    import java.lang.Object;

    package a.b.c.d { }

    entity aaa { prop1 : Object

    op oper1(Object obj1, Object obj2):Object {
        int i = 1;
    }
    

    }

But then:

  • java.lang.Object,
  • Object,
  • int i

are not recognized. I thought that it will work out-of-the-box when xtext extends xbase instead of terminals and type is defined ad JvmType

Is this example broken or something?

Same thing is when I use home automation code from xtext documentation. All types from Jvm are not recognized as well as fire and println methods. http://www.eclipse.org/Xtext/documentation/307_special_languages.html

1

1 Answers

1
votes

Make sure

  1. The test project is a Java project
  2. The test project has Xtext nature
  3. Build automatically is enabled
  4. The model files are in a source folder