void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { boolean isWellKnownPackage = ApplicationManager.getApplication() .getService(PyPIPackageRanking.class) .getPackageRank().containsKey(myPackageName); boolean confirmationEnabled = PropertiesComponent.getInstance().getBoolean(CONFIRM_PACKAGE_INSTALLATION_PROPERTY, true); if (!isWellKnownPackage && confirmationEnabled) { boolean confirmed = MessageDialogBuilder .yesNo(PyBundle.message("python.packaging.dialog.title.install.package.confirmation"), PyBundle.message("python.packaging.dialog.message.install.package.confirmation", myPackageName)) .icon(AllIcons.General.WarningDialog) .doNotAsk(new ConfirmPackageInstallationDoNotAskOption()) .ask(project); if (!confirmed) { return; } } PsiElement element = descriptor.getPsiElement(); if (element == null) return; Module module = ModuleUtilCore.findModuleForPsiElement(element); Sdk sdk = PythonSdkUtil.findPythonSdk(element); if (module != null && sdk != null) { new PyInstallRequirementsFix( getFamilyName(), module, sdk, Collections.singletonList(PyRequirementsKt.pyRequirement(myPackageName)), Collections.emptyList(), new RunningPackagingTasksListener(module) { @Override public void finished(List<ExecutionException> exceptions) { super.finished(exceptions); if (exceptions.isEmpty()) { onSuccess(descriptor); } } } ).applyFix(module.getProject(), descriptor); } }