diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/dfaassist/DfaAssist.java b/java/debugger/impl/src/com/intellij/debugger/engine/dfaassist/DfaAssist.java index 9c18d706e798..d7eb1ae6bc9b 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/dfaassist/DfaAssist.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/dfaassist/DfaAssist.java @@ -24,6 +24,7 @@ import com.intellij.openapi.editor.Inlay; import com.intellij.openapi.editor.InlayModel; import com.intellij.openapi.editor.impl.EditorImpl; import com.intellij.openapi.fileEditor.FileEditorManager; +import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.TextRange; @@ -76,7 +77,8 @@ public class DfaAssist implements DebuggerContextListener { return; } StackFrame frame = proxy.getStackFrame(); - Map hints = ReadAction.compute(() -> computeHints(frame, element)); + Map hints = + ReadAction.nonBlocking(() -> computeHints(frame, element)).withDocumentsCommitted(myProject).executeSynchronously(); displayInlays(hints, sourcePosition); } }); @@ -120,8 +122,8 @@ public class DfaAssist implements DebuggerContextListener { @NotNull static Map computeHints(@NotNull StackFrame frame, @NotNull PsiElement element) { + if (!element.isValid() || DumbService.isDumb(element.getProject())) return Collections.emptyMap(); Method method = frame.location().method(); - if (!element.isValid()) return Collections.emptyMap(); PsiMethod psiMethod = PsiTreeUtil.getParentOfType(element, PsiMethod.class); boolean methodMatches = false;