PsiDirectory (DataContext dataContext, IdeView view) { final Module module = PlatformCoreDataKeys.MODULE.getData(dataContext); if (module != null) { final Collection<VirtualFile> sourceRoots = PyUtil.getSourceRoots(module); if (sourceRoots.size() > 0) { return PsiManager.getInstance(module.getProject()).findDirectory(sourceRoots.iterator().next()); } } return super.getTargetDirectory(dataContext, view); }