Set<BasePsiElement> objectDefinitions = lookupAdapter.collectInParentScopeOf(element);
if (objectDefinitions != null) {
for (BasePsiElement psiElement : objectDefinitions) {
if (psiElement instanceof IdentifierPsiElement) {
IdentifierPsiElement identifierPsiElement = (IdentifierPsiElement) psiElement;
PsiElement referencedPsiElement = identifierPsiElement.resolve();
if (referencedPsiElement instanceof DBObject) {
DBObject object = (DBObject) referencedPsiElement;
LookupItemFactory lookupItemFactory = object.getLookupItemFactory(identifierElementType.getLanguage());
lookupItemFactory.createLookupItem(object, consumer);
}