boolean (@NotNull final PsiExpression argument, @NotNull PsiElement scope, @NotNull PsiManager manager, @NotNull final Processor<? super PsiExpression> processor) { SliceAnalysisParams params = new SliceAnalysisParams(); params.dataFlowToThis = true; params.scope = new AnalysisScope(new LocalSearchScope(scope), manager.getProject()); SliceRootNode rootNode = new SliceRootNode(manager.getProject(), new DuplicateMap(), LanguageSlicing.getProvider(argument).createRootUsage(argument, params)); Collection<? extends AbstractTreeNode<?>> children = ProgressManager.getInstance().runProcess( () -> rootNode.getChildren().iterator().next().getChildren(), new ProgressIndicatorBase()); for (AbstractTreeNode<?> child : children) { SliceUsage usage = (SliceUsage)child.getValue(); PsiElement element = usage != null ? usage.getElement() : null; if (element instanceof PsiExpression expression && !processor.process(expression)) return false; } return !children.isEmpty(); }