DBObjectBundle objectBundle = connectionHandler.getObjectBundle();
if (sourceElement.getParent() instanceof QualifiedIdentifierPsiElement && sourceElement.getParent().getFirstChild() != sourceElement) {
QualifiedIdentifierPsiElement qualifiedIdentifierPsiElement = (QualifiedIdentifierPsiElement) sourceElement.getOriginalElement().getParent();
DBObject parentObject = qualifiedIdentifierPsiElement.lookupParentObjectFor(identifierElementType);
if (parentObject != null) {
DBSchema currentSchema = PsiUtil.getCurrentSchema(sourceScope);
objectBundle.lookupChildObjectsOfType(
consumer,
parentObject,
objectType,
filter,
currentSchema);
}
} else if (!identifierElementType.isLocalReference()){
Set<DBObject> parentObjects = LeafPsiElement.identifyPotentialParentObjects(objectType, filter, sourceScope, null);
if (parentObjects != null && parentObjects.size() > 0) {
for (DBObject parentObject : parentObjects) {
DBSchema currentSchema = PsiUtil.getCurrentSchema(sourceScope);
objectBundle.lookupChildObjectsOfType(
consumer,
parentObject.getUndisposedElement(),
objectType,
filter,