executablePsiElement.getNode(),
executablePsiElement.getTextRange());
descriptors.add(foldingDescriptor);
}
} else if (child instanceof ChameleonPsiElement) {
ChameleonPsiElement chameleonPsiElement = (ChameleonPsiElement) child;
FoldingDescriptor foldingDescriptor = new FoldingDescriptor(
chameleonPsiElement.getNode(),
chameleonPsiElement.getTextRange());
descriptors.add(foldingDescriptor);
FoldingBuilder foldingBuilder = LanguageFolding.INSTANCE.forLanguage(chameleonPsiElement.getLanguage());
FoldingDescriptor[] nestedDescriptors = foldingBuilder.buildFoldRegions(chameleonPsiElement.getNode(), document);
descriptors.addAll(Arrays.asList(nestedDescriptors));
}
child = child.getNextSibling();
}