use of org.eclipse.xtext.validation.IssueSeverities in project xtext-xtend by eclipse.
the class CachingResourceValidatorImpl method addWarningsForOrphanedJvmElements.
private void addWarningsForOrphanedJvmElements(final Resource resource, final CancelIndicator monitor, final IAcceptor<Issue> acceptor) {
final IssueSeverities issueSeverities = this.issueSeveritiesProvider.getIssueSeverities(resource);
final Severity severity = issueSeverities.getSeverity(IssueCodes.ORPHAN_ELMENT);
boolean _equals = Objects.equal(severity, Severity.IGNORE);
if (_equals) {
return;
}
Iterable<JvmDeclaredType> _filter = Iterables.<JvmDeclaredType>filter(IterableExtensions.<EObject>tail(resource.getContents()), JvmDeclaredType.class);
for (final JvmDeclaredType jvmType : _filter) {
final Function1<JvmMember, Boolean> _function = (JvmMember it) -> {
boolean _isSynthetic = this._jvmTypeExtensions.isSynthetic(it);
return Boolean.valueOf((!_isSynthetic));
};
Iterable<JvmMember> _iterable = IteratorExtensions.<JvmMember>toIterable(IteratorExtensions.<JvmMember>filter(Iterators.<JvmMember>filter(jvmType.eAllContents(), JvmMember.class), _function));
for (final JvmMember jvmMember : _iterable) {
{
this.operationCanceledManager.checkCanceled(monitor);
final EObject sourceElement = this._iJvmModelAssociations.getPrimarySourceElement(jvmMember);
if ((sourceElement == null)) {
this.addWarningForOrphanedJvmElement(resource, jvmMember, severity, acceptor);
}
}
}
}
}
Aggregations