Module (@NotNull Project project) { for (PrimaryModuleManager primaryModuleManager : EP_NAME.getExtensionList()) { Module primaryModule = primaryModuleManager.getPrimaryModule(project); if (primaryModule != null) { return primaryModule; } } return getPrimaryModuleByContentRoot(project); }