PsiDirectory () { if (myModule == null) return null; return ReadAction.compute(() -> { ModuleRootManager moduleManager = ModuleRootManager.getInstance(myModule); PsiManager psiManager = PsiManager.getInstance(myModule.getProject()); return findJavaDirectory(psiManager, moduleManager.getSourceRoots(false)); }); }