CustomFoldingProvider (@NotNull PsiElement element) { ASTNode node = element.getNode(); if (node != null) { for (CustomFoldingProvider provider : CustomFoldingProvider.getAllProviders()) { if (provider.isCustomRegionStart(node.getText())) { return provider; } } } return null; }