void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); if (element != null) { final PyPackageRequirementsInspection inspection = getInstance(element); if (inspection != null) { final Set<String> packagesToIgnore = new HashSet<>(myPackageNames); for (String pkg : inspection.ignoredPackages) { packagesToIgnore.remove(pkg); } if (!packagesToIgnore.isEmpty()) { inspection.ignoredPackages.addAll(packagesToIgnore); final ProjectInspectionProfileManager profileManager = ProjectInspectionProfileManager.getInstance(project); profileManager.fireProfileChanged(); final Notification notification = BALLOON_NOTIFICATIONS .createNotification( packagesToIgnore.size() == 1 ? PyPsiBundle.message("INSP.package.requirements.requirement.has.been.ignored", packagesToIgnore.iterator().next()) : PyPsiBundle.message("INSP.package.requirements.requirements.have.been.ignored"), NotificationType.INFORMATION ); notification.addAction( NotificationAction .createSimpleExpiring( ActionsBundle.message("action.$Undo.text"), () -> { inspection.ignoredPackages.removeAll(packagesToIgnore); profileManager.fireProfileChanged(); } ) ); notification.addAction( NotificationAction .createSimpleExpiring( PyBundle.message("notification.action.edit.settings"), () -> { final InspectionProfileImpl profile = profileManager.getCurrentProfile(); final String toolName = PyPackageRequirementsInspection.class.getSimpleName(); EditInspectionToolsSettingsAction.editToolSettings(project, profile, toolName); } ) ); notification.notify(project); } } } }