Module (ConfigurationContext context) { Module module = context.getModule(); if (module != null) return module; Location contextLocation = context.getLocation(); if (contextLocation == null) return null; PsiElement locationElement = contextLocation.getPsiElement(); return ModuleUtilCore.findModuleForPsiElement(locationElement); }