SelectInContext (AnActionEvent event) { final DataContext dataContext = event.getDataContext(); PsiElement psiElement = CommonDataKeys.PSI_ELEMENT.getData(dataContext); if (psiElement == null || !psiElement.isValid()) { return null; } PsiFile psiFile = psiElement.getContainingFile(); if (psiFile == null) { return createFileSystemItemContext(psiElement); } return new SmartSelectInContext(psiFile, psiElement); }