use of org.eclipse.n4js.ts.types.SyntaxRelatedTElement in project n4js by eclipse.
the class N4JSDReader method getRealTopLevelTypes.
/**
* The method {@link TModule#getTopLevelTypes()} returns also functions that are nested in functions. These are
* filtered out in this method.
*
* @return real top level types
*/
private Collection<Type> getRealTopLevelTypes(Script script) {
Collection<Type> realTLT = new LinkedList<>();
for (Type tlt : script.getModule().getTopLevelTypes()) {
if (tlt instanceof SyntaxRelatedTElement) {
SyntaxRelatedTElement srte = (SyntaxRelatedTElement) tlt;
EObject astElem = srte.getAstElement();
astElem = astElem != null ? astElem.eContainer() : null;
FunctionOrFieldAccessor fofa = EcoreUtil2.getContainerOfType(astElem, FunctionOrFieldAccessor.class);
if (fofa != null) {
continue;
}
}
realTLT.add(tlt);
}
return realTLT;
}
Aggregations