static PsiFunctionalExpression @NotNull [] retrieveFunExpressionsByIndices(@NotNull IntSet indices,
                                                                             @NotNull PsiFileWithStubSupport psiFile) {
    StubbedSpine spine = psiFile.getStubbedSpine();

    PsiFunctionalExpression[] result = new PsiFunctionalExpression[indices.size()];
    int resIdx = 0;
    int funExprIdx = 0;
    for (int i = 0; i < spine.getStubCount(); i++) {
      if (FUN_EXPR.contains(spine.getStubType(i)) && indices.contains(funExprIdx++)) {
        result[resIdx++] = (PsiFunctionalExpression)spine.getStubPsi(i);
      }
    }

    if (result.length != resIdx) {
      CompilerReferenceServiceImpl compilerReferenceService = (CompilerReferenceServiceImpl)CompilerReferenceService.getInstance(psiFile.getProject());
      Set<Module> state = compilerReferenceService.getDirtyScopeHolder().getAllDirtyModules();
      VirtualFile file = psiFile.getVirtualFile();
      Module moduleForFile = ProjectFileIndex.getInstance(psiFile.getProject()).getModuleForFile(file);
      LOG.error("Compiler functional expression index doesn't match to stub index.\n" +
                "Functional expression indices: " + indices + "\n" +
                "Does the file belong to dirty scope?: " + state.contains(moduleForFile),
                new Attachment(psiFile.getName(), psiFile.getText()));
      return ContainerUtil.filter(result, Objects::nonNull).toArray(PsiFunctionalExpression.EMPTY_ARRAY);
    }

    return result;
  }
static PsiFunctionalExpression @NotNull [] retrieveFunExpressionsByIndices(@NotNull IntSet indices,
                                                                             @NotNull PsiFileWithStubSupport psiFile)