Module (@NotNull Project project) { IProjectStore store = ProjectKt.getStateStore(project); Path proDir = store.getProjectFilePath().getParent(); Path modulePath = proDir.resolve(project.getName() + ".iml"); ModuleType<?> defType = ModuleTypeManager.getInstance().getDefaultModuleType(); return ModuleManager.getInstance(project).newModule(modulePath, defType.getId()); }