// containing the lookup name back.
final LookupEx activeLookup = LookupManager.getActiveLookup(editor);
if ((activeLookup != null) && activeLookup.isFocused()) {
final PsiElement elementAt = file.findElementAt(editor.getCaretModel().getOffset() - 1);
if (elementAt != null) {
Symbol lookup = new SymbolImpl(elementAt.getNode());
final LookupElement currentItem = activeLookup.getCurrentItem();
final String lookupString = currentItem != null ? currentItem.getLookupString() : "";
lookup.setName(lookupString);
return lookup;
}
}
if (contextElement != null) {