PsiElement (@NotNull DataContext dataContext, @Nullable Editor editor) { PsiFile file = CommonDataKeys.PSI_FILE.getData(dataContext); return (file != null && editor != null) ? file.findElementAt(editor.getCaretModel().getOffset()) : null; }