List<String> (@NotNull Module module) { // TODO: Cache found module packages, clear cache on module updates final List<String> packageNames = new ArrayList<>(); final Project project = module.getProject(); VirtualFile[] roots = ModuleRootManager.getInstance(module).getSourceRoots(); if (roots.length == 0) { roots = ModuleRootManager.getInstance(module).getContentRoots(); } for (VirtualFile root : roots) { collectPackageNames(project, root, packageNames); } return packageNames; }