* @return
* @throws IOException
*/
public static IScope getFullScope(TranslationUnit trunit, EClass type) throws Exception {
IScope outer = IScope.NULLSCOPE;
Collection<TranslationUnit> loaded = new LinkedList<TranslationUnit>();
// Tambien es visible lo ya cargado
Resource resource = trunit.eResource();
ResourceSet resourceSet = resource.getResourceSet();
EList<Resource> resources = resourceSet.getResources();
int index = resources.indexOf(resource);
for (int i = 0; i < index; i++) {
loaded.add((TranslationUnit) resources.get(i).getContents().get(0));
}
if (!loaded.isEmpty())
outer = depthTraverse(type, loaded.iterator());
IScope scope = getScope(trunit, type);
outer = concatenate(outer, scope.getOuterScope());
return new SimpleScope(outer, scope.getContents());
}