I got a scenario, which i feel its a quite a generic feature, that xtext should provide.
A.mydsl has some types defined.
B.mydsl extends A.mydsl using importuri feature(we can say it is nothing but include)
So i am able to get to use the types that are defined in A.mydsl and B.mydsl in B.mydsl.
This is perfect as expected.
Now lets Assume, we have C.mydsl extends B.mydsl , But here i get to use types that are defined in B.mydsl and C.mydsl. I am not getting the types that are defined in A.mydsl.
Is there a way that we can achieve without adding the extra import.
I don't quite understand your question. At some point you have to declare the import. Either the user does it in the model file, or the scoping mechanism adds the import implicitly. I talked about the second option.
The comparison with java does not work out!
a) not the file B.java extends the the file A.java, but the class B defined in B.java extends the class A in A.java
b) you don't use an import mechanism in java, but qualified names. The imports are only used to allow short names instead of the fully qualified names.
c) getABC() can be used in C because the scoping walks up the type hierarchy.
a) and b) is exactly what Xtext's qualified name fragment does for you. Resources (model files) export elements under a qualified name, other resources can reference these elements without explicitly having to import the containing files (as needed with the URI import).
c) you'll have to implement yourself using scoping because Xtext does not attach any meaning to a reference defined in the grammar.