use of org.eclipse.xtext.documentation.IEObjectDocumentationProviderExtension in project xtext-xtend by eclipse.
the class XtendValidator method checkJavaDocRefs.
@Check
public void checkJavaDocRefs(XtendMember member) {
if (isIgnored(IssueCodes.JAVA_DOC_LINKING_DIAGNOSTIC))
return;
List<INode> documentationNodes = ((IEObjectDocumentationProviderExtension) documentationProvider).getDocumentationNodes(member);
for (INode node : documentationNodes) {
for (ReplaceRegion region : javaDocTypeReferenceProvider.computeTypeRefRegions(node)) {
String typeRefString = region.getText();
if (typeRefString != null && typeRefString.length() > 0) {
IScope scope = scopeProvider.getScope(member, TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE);
IEObjectDescription candidate = scope.getSingleElement(qualifiedNameConverter.toQualifiedName(typeRefString));
if (candidate == null) {
Severity severity = getIssueSeverities(getContext(), getCurrentObject()).getSeverity(IssueCodes.JAVA_DOC_LINKING_DIAGNOSTIC);
if (severity != null)
getChain().add(createDiagnostic(severity, "javaDoc: " + typeRefString + " cannot be resolved to a type", member, region.getOffset(), region.getLength(), IssueCodes.JAVA_DOC_LINKING_DIAGNOSTIC));
}
}
}
}
}
Aggregations