@Override
  public boolean isReparseable(@NotNull ASTNode currentNode,
                               @NotNull CharSequence newText,
                               @NotNull Language fileLanguage,
                               @NotNull Project project) {
    if (!Registry.is("python.statement.lists.incremental.reparse")) {
      return false;
    }

    if (LOG.isDebugEnabled()) {
      LOG.debug("Attempting to reparse lazy element of type " + this
                + "\nparent: " + currentNode.getTreeParent()
                + "\nold text: \n" + currentNode.getText()
                + "\n\nnew text: \n" + newText);
    }

    if (newText.isEmpty() || !fileLanguage.is(PythonLanguage.INSTANCE)) { // do not reparse Cython statement lists
      return false;
    }

    // Error elements on top level of previous statement list may cause some errors to remain in the PSI tree after reparse
    boolean parentContainsErrors =
      ContainerUtil.findInstance(((PyStatementListImpl)currentNode).getChildren(), PsiErrorElement.class) != null;

    if (parentContainsErrors) {
      LOG.debug("Previous node contains PsiErrorElement, reparse is declined");
      return false;
    }

    boolean isAfterColonOnSameLine = isAfterColonOnSameLine((PyStatementListImpl)currentNode);

    String firstLineIndent = isAfterColonOnSameLine ? "" : PyIndentUtil.getElementIndent(currentNode.getPsi());

    PythonIndentingLexerForLazyElements lexer = new PythonIndentingLexerForLazyElements(firstLineIndent.length());
    return checkIndentDedentBalanceWithLexer(newText, lexer, isAfterColonOnSameLine);
  }
@Override
  public boolean isReparseable(@NotNull ASTNode currentNode,
                               @NotNull CharSequence newText,
                               @NotNull Language fileLanguage,
                               @NotNull Project project)