use of org.eclipse.xtext.xbase.imports.TypeUsages in project xtext-xtend by eclipse.
the class TypeUsageCollectorTest method hasUnresolvedType.
private void hasUnresolvedType(final Resource resource, final String... typeNames) {
final TypeUsages typeUsages = this.typeUsageCollector.collectTypeUsages(((XtextResource) resource));
final Function1<TypeUsage, String> _function = (TypeUsage it) -> {
return it.getUsedTypeName();
};
final Set<String> usedNames = IterableExtensions.<String>toSet(ListExtensions.<TypeUsage, String>map(typeUsages.getUnresolvedTypeUsages(), _function));
Assert.assertEquals(IterableExtensions.<String>toSet(((Iterable<String>) Conversions.doWrapArray(typeNames))), usedNames);
}
use of org.eclipse.xtext.xbase.imports.TypeUsages in project xtext-xtend by eclipse.
the class TypeUsageCollectorTest method hasUnresolvedTypeSuffix.
private void hasUnresolvedTypeSuffix(final CharSequence xtendFile, final String... suffix) {
try {
final Resource resource = this.file(xtendFile.toString()).eResource();
final TypeUsages typeUsages = this.typeUsageCollector.collectTypeUsages(((XtextResource) resource));
final Function1<TypeUsage, String> _function = (TypeUsage it) -> {
return it.getSuffix();
};
final Set<String> foundSuffix = IterableExtensions.<String>toSet(ListExtensions.<TypeUsage, String>map(typeUsages.getUnresolvedTypeUsages(), _function));
Assert.assertEquals(IterableExtensions.<String>toSet(((Iterable<String>) Conversions.doWrapArray(suffix))), foundSuffix);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations