Object () { if (!(super.getCurrentEditorElement() instanceof PsiElement element)) { return null; } final Collection<PsiSymbolDeclaration> declarations = filter(Declarations.allDeclarationsInElement(element), this::shouldCreateNode); if (declarations.isEmpty()) { return element; } final Editor editor = getEditor(); if (editor == null) { return element; } final int offset = editor.getCaretModel().getOffset(); final PsiSymbolDeclaration declaration = coalesce(find(declarations, it -> it.getAbsoluteRange().containsOffset(offset)), getFirstItem(declarations)); return new DelegatingPsiElementWithSymbolPointer(element, declaration.getSymbol().createPointer()); }