[xcore] Error on referring imported xcore classes [message #1728500] |
Tue, 05 April 2016 03:16 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
I have two xcore files in one xtext project:
Greetings.xcore:
package org.xtext.example.mydsl
import org.xtext.example.mydsl.dir.Directory
class Model {
contains Greeting[] greetings
}
class Greeting {
String name
String greeting
contains Directory dir
}
Directory.xcore
package org.xtext.example.mydsl.dir
class Directory {
String address
}
The content assist was able to see the Directory class when I referred to it in Greetings.xcore. But, I am getting the errors:
Description Resource Path Location Type
A generic type in this context must refer to a classifier or a type parameter Greetings.xcore /org.xtext.example.mydsl/model line: 12 /org.xtext.example.mydsl/model/Greetings.xcore Xcore Problem
Description Resource Path Location Type
Couldn't resolve reference to GenBase 'Directory'. Greetings.xcore /org.xtext.example.mydsl/model line: 12 /org.xtext.example.mydsl/model/Greetings.xcore Xcore Problem
Does xcore support reference to imported classes? What am i missing?
[Updated on: Tue, 05 April 2016 06:32] Report message to a moderator
|
|
|
|
Re: [xcore] Error on referring imported xcore classes [message #1728513 is a reply to message #1728511] |
Tue, 05 April 2016 07:00 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
Hi,
My two xcore files are in the same directory and same project.
I am not sure if this matters but my MyDsl.xtext grammar only contains this (the Directory class was not referred to in my grammar):
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
import "org.xtext.example.mydsl"
Model:
greetings+=Greeting*;
Greeting:
'Hello' name=ID '!';
The both Directory.xcore and Greetings.xcore will generate the files in emf-gen. I have also added these in my GenerateMyDsl.mwe2.
loadedResource = "platform:/resource/${projectName}/model/Greetings.xcore"
loadedResource = "platform:/resource/${projectName}/model/Directory.xcore"
[Updated on: Tue, 05 April 2016 07:01] Report message to a moderator
|
|
|
|
|
Re: [xcore] Error on referring imported xcore classes [message #1728537 is a reply to message #1728534] |
Tue, 05 April 2016 09:28 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Chris,
Given I can't reproduce it using this same approach, you're probably
best to install the latest Mars.2 released version and hope that this
fixes the problem.
On 05.04.2016 11:02, chris yo wrote:
> I created a new Xcore project (File -> New -> Project -> Xcore ->
> Xcore project). And placed both files inside the model directory and
> the error is still the same. So, I would say that this might be purely
> an xcore problem.
>
> I am using this version of xcore:
> EMF Xcore
> Version: 1.3.0.v20150527-0312
> Build id: S201505270312
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03237 seconds