From 23f8da3a3e358801d95ee3d0f7ccf1e1a3a889f4 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 22 Jul 2016 13:22:43 +0300 Subject: [PATCH] cleanup, checkCanceled --- .../properties/editor/PropertiesInheritorsSearcher.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java index 4a79c1ef8e4d..9ddc865c55d1 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java @@ -23,6 +23,7 @@ import com.intellij.lang.properties.psi.Property; import com.intellij.openapi.application.QueryExecutorBase; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.progress.ProgressManager; import com.intellij.psi.PsiElement; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.searches.DefinitionsScopedSearch; @@ -36,7 +37,7 @@ import java.util.Objects; * @author Dmitry Batkovich */ public class PropertiesInheritorsSearcher extends QueryExecutorBase { - private final static Logger LOG = Logger.getInstance(PropertiesInheritorsSearcher.class); + private static final Logger LOG = Logger.getInstance(PropertiesInheritorsSearcher.class); @Override public void processQuery(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor consumer) { @@ -60,7 +61,10 @@ public class PropertiesInheritorsSearcher extends QueryExecutorBase f.findPropertyByKey(key)) .filter(Objects::nonNull) .map(IProperty::getPsiElement) - .forEach(consumer::process); + .anyMatch(psiElement -> { + ProgressManager.checkCanceled(); + return !consumer.process(psiElement); + }); }); }