From bc3b7f82352ad563338a9dd3900d4f8b785ce92f Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Tue, 20 Aug 2024 18:35:39 +0400 Subject: [PATCH] drop `allowSlowOperations` usages GitOrigin-RevId: b60b929f767c5fdac1e63ce8cfabb97c43c189c1 --- .../IntroduceVariableBase.java | 6 ++---- .../execution/ui/RedesignedRunWidget.kt | 20 +++++++++---------- .../newvfs/persistent/PersistentFSImpl.java | 4 ---- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/java/java-impl-refactorings/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java b/java/java-impl-refactorings/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java index 908f5d50a6f6..168df2cfe488 100644 --- a/java/java-impl-refactorings/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java +++ b/java/java-impl-refactorings/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java @@ -53,7 +53,6 @@ import com.intellij.refactoring.util.occurrences.NotInConstructorCallFilter; import com.intellij.util.CommonJavaRefactoringUtil; import com.intellij.util.IncorrectOperationException; import com.intellij.util.Processor; -import com.intellij.util.SlowOperations; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.MultiMap; import com.siyeh.ig.psiutils.VariableAccessUtils; @@ -404,9 +403,8 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase { dialogIntroduce.accept(null); } else { - SlowOperations.allowSlowOperations( - () -> dumbService.runWithAlternativeResolveEnabled( - () -> inplaceIntroduce(project, editor, choice, targetContainer, occurrenceManager, originalType, dialogIntroduce))); + dumbService.runWithAlternativeResolveEnabled( + () -> inplaceIntroduce(project, editor, choice, targetContainer, occurrenceManager, originalType, dialogIntroduce)); } } diff --git a/platform/execution-impl/src/com/intellij/execution/ui/RedesignedRunWidget.kt b/platform/execution-impl/src/com/intellij/execution/ui/RedesignedRunWidget.kt index b09f3e5e0913..dc37698c213e 100644 --- a/platform/execution-impl/src/com/intellij/execution/ui/RedesignedRunWidget.kt +++ b/platform/execution-impl/src/com/intellij/execution/ui/RedesignedRunWidget.kt @@ -407,17 +407,17 @@ private class MoreRunToolbarActions : TogglePopupAction( } internal fun filterOutRunIfDebugResumeIsPresent(e: AnActionEvent, actions: List): List { - val hasPause = actions.any { - it.javaClass.simpleName.let { it == "InlineXDebuggerResumeAction" || it == "ConfigurationXDebuggerResumeAction" } || + val hasPause = actions.find { + it.javaClass.simpleName.let { + it == "InlineXDebuggerResumeAction" || + it == "ConfigurationXDebuggerResumeAction" + } || e.actionManager.getId(it)?.contains("XDebuggerResumeAction") == true - } - val hasInlineStop = actions.any { - it.javaClass.simpleName.let { it == "StopConfigurationInlineAction" } - } - return when { - hasPause -> actions.filter { ((it as? ExecutorAction)?.id ?: e.actionManager.getId(it)) != "Run" } - hasInlineStop -> actions.filter { ((it as? ExecutorAction)?.id ?: e.actionManager.getId(it)) != "Debug" } - else -> actions + + } != null + if (!hasPause) return actions + return actions.filter { + ((it as? ExecutorAction)?.id ?: e.actionManager.getId(it)) != "Run" } } diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index 2c1ef4c5a394..25ce37a6eed8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -2063,10 +2063,6 @@ public final class PersistentFSImpl extends PersistentFS implements Disposable { } private void applyEvent(@NotNull VFileEvent event) { - SlowOperations.allowSlowOperations(() -> doApplyEvent(event)); - } - - private void doApplyEvent(@NotNull VFileEvent event) { if (LOG.isDebugEnabled()) { LOG.debug("Applying " + event); }