void (@NotNull AnActionEvent e) { DataContext dataContext = e.getDataContext(); Project project = e.getProject(); if (project == null) return; PsiDocumentManager.getInstance(project).commitAllDocuments(); // prevents problems with smart pointers creation HierarchyProvider provider = getProvider(e); if (provider == null) return; PsiElement target = provider.getTarget(dataContext); if (target == null) return; createAndAddToPanel(project, provider, target); }