PsiElement (@NotNull DataContext dataContext) { PsiFile file = CommonDataKeys.PSI_FILE.getData(dataContext); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext); if (file != null && editor != null) { return getContextElement(file, editor); } return element == null ? file : element; }