use of org.eclipse.xtext.xtext.generator.model.TypeReference in project xtext-core by eclipse.
the class ImportURIScopingFragment2 method getDelegateScopeProvider.
@Override
public TypeReference getDelegateScopeProvider() {
TypeReference _xifexpression = null;
boolean _inheritsXbase = this._xbaseUsageDetector.inheritsXbase(this.getLanguage().getGrammar());
if (_inheritsXbase) {
_xifexpression = TypeReference.typeRef("org.eclipse.xtext.xbase.scoping.XImportSectionNamespaceScopeProvider");
} else {
_xifexpression = TypeReference.typeRef(SimpleLocalScopeProvider.class);
}
return _xifexpression;
}
use of org.eclipse.xtext.xtext.generator.model.TypeReference in project xtext-core by eclipse.
the class TypeReferenceTest method testBug508810.
@Test
public void testBug508810() {
final ResourceSetImpl rs = new ResourceSetImpl();
final TypeReference ref = new TypeReference(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, rs);
Assert.assertEquals("java.util.Map.Entry", ref.getName());
}
use of org.eclipse.xtext.xtext.generator.model.TypeReference in project xtext-core by eclipse.
the class TypeReferenceTest method testNestedType.
@Test
public void testNestedType() {
final TypeReference ref = new TypeReference("java.util", "Map.Entry");
Assert.assertEquals("java.util", ref.getPackageName());
Assert.assertEquals("Entry", ref.getSimpleName());
Assert.assertEquals(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("Map", "Entry")), ref.getSimpleNames());
}
use of org.eclipse.xtext.xtext.generator.model.TypeReference in project xtext-core by eclipse.
the class TypeReferenceTest method testPackageName.
@Test
public void testPackageName() {
final TypeReference ref = TypeReference.typeRef("org.example.MyType");
Assert.assertEquals("MyType", ref.getSimpleName());
Assert.assertEquals("org.example", ref.getPackageName());
}
use of org.eclipse.xtext.xtext.generator.model.TypeReference in project xtext-core by eclipse.
the class TypeReferenceTest method testXtendPath.
@Test
public void testXtendPath() {
final TypeReference ref = TypeReference.typeRef("org.example.MyType");
Assert.assertEquals("org/example/MyType.xtend", ref.getXtendPath());
}
Aggregations