use of org.eclipse.xtext.ui.workspace.EclipseSourceFolder in project xtext-eclipse by eclipse.
the class JdtProjectConfig method getSourceFolders.
@Override
public Set<? extends ISourceFolder> getSourceFolders() {
try {
final IJavaProject javaProject = JavaCore.create(this.getProject());
boolean _exists = javaProject.exists();
boolean _not = (!_exists);
if (_not) {
return CollectionLiterals.<ISourceFolder>emptySet();
}
final IClasspathEntry[] classpath = javaProject.getRawClasspath();
final Function1<IClasspathEntry, Boolean> _function = (IClasspathEntry it) -> {
int _entryKind = it.getEntryKind();
return Boolean.valueOf((_entryKind == IClasspathEntry.CPE_SOURCE));
};
final Iterable<IClasspathEntry> sourceEntries = IterableExtensions.<IClasspathEntry>filter(((Iterable<IClasspathEntry>) Conversions.doWrapArray(classpath)), _function);
final Function1<IClasspathEntry, String> _function_1 = (IClasspathEntry it) -> {
return it.getPath().removeFirstSegments(1).toString();
};
final Iterable<String> sourceFolders = IterableExtensions.<IClasspathEntry, String>map(sourceEntries, _function_1);
final Function1<String, EclipseSourceFolder> _function_2 = (String it) -> {
IProject _project = this.getProject();
return new EclipseSourceFolder(_project, it);
};
return IterableExtensions.<EclipseSourceFolder>toSet(IterableExtensions.<String, EclipseSourceFolder>map(sourceFolders, _function_2));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations