[mod-commands] Use expireWith(project)

GitOrigin-RevId: 9f5bc7bd8f2488cd739147e246b8dd021eb025bb
This commit is contained in:
Tagir Valeev
2023-12-12 14:11:46 +00:00
committed by intellij-monorepo-bot
parent d8175c6e01
commit e663f8c86f
2 changed files with 2 additions and 2 deletions
@@ -211,7 +211,7 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
ActionContext actionContext = ActionContext.from(editor, psiFile);
ThrowableComputable<Boolean, RuntimeException> computable =
() -> ReadAction.nonBlocking(() -> modCommand.getPresentation(actionContext) != null)
.expireWhen(() -> project.isDisposed())
.expireWith(project)
.executeSynchronously();
return ProgressManager.getInstance().runProcessWithProgressSynchronously(
computable, LangBundle.message("command.check.availability.for", modCommand.getFamilyName()), true, project);
@@ -95,7 +95,7 @@ public final class CleanupInspectionUtilImpl implements CleanupInspectionUtil {
if (batchFix instanceof ModCommandBatchQuickFix modCommandBatchQuickFix) {
ThrowableComputable<ModCommand, RuntimeException> actionComputable =
() -> ReadAction.nonBlocking(() -> modCommandBatchQuickFix.perform(myProject, myBatchModeDescriptors))
.expireWhen(() -> myProject.isDisposed())
.expireWith(myProject)
.executeSynchronously();
ModCommand command = ProgressManager.getInstance().runProcessWithProgressSynchronously(
actionComputable, LangBundle.message("apply.fixes"), true, myProject);