From 914bb330963251d486b14d9d1a4f57a862b56308 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 22 Apr 2022 17:04:44 +0200 Subject: [PATCH] [search] start non-blocking read action for access (IDEA-292724) GitOrigin-RevId: 6b7894773886e9b0e1014c85fbf660c133f668e2 --- .../impl/search/JavaFunctionalExpressionSearcher.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java index f0dd9b8a2c76..3853fbf6bbaf 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.psi.impl.search; import com.intellij.compiler.CompilerDirectHierarchyInfo; @@ -168,16 +168,17 @@ public final class JavaFunctionalExpressionSearcher extends QueryExecutorBase occurrences, @NotNull Project project) { - Map map = new HashMap<>(); - DumbService.getInstance(project).runReadActionInSmartMode(() -> { + return ReadAction.nonBlocking(() -> { + Map map = new HashMap<>(); for (FunExprOccurrence occurrence : occurrences) { ThreeState result = occurrence.checkHasTypeLight(samClasses, vFile); if (result != ThreeState.NO) { map.put(occurrence, result == ThreeState.YES ? Confidence.sure : Confidence.needsCheck); } } - }); - return map; + return map; + }).inSmartMode(project) + .executeSynchronously(); } private enum Confidence { sure, needsCheck}