@Override public FoldingDescriptor[] buildFoldRegions(ASTNode node,Document document){
  List<FoldingDescriptor> descriptors=Lists.newArrayList();
  if (node instanceof FileASTNode) {
    for (    ASTNode child : node.getChildren(null)) {
      addDescriptors(descriptors,child);
    }
  }
 else   if (isTopLevel(node)) {
    addDescriptors(descriptors,node);
  }
  return descriptors.toArray(new FoldingDescriptor[0]);
}

@ Override public FoldingDescriptor [ ] buildFoldRegions ( ASTNode node , Document document ) { List < FoldingDescriptor > descriptors = Lists . newArrayList ( ) ; if ( node instanceof FileASTNode ) { for ( ASTNode child : node . getChildren ( null ) ) { addDescriptors ( descriptors , child ) ; } } else if ( isTopLevel ( node ) ) { addDescriptors ( descriptors , node ) ; } return descriptors . toArray ( new FoldingDescriptor [ 0 ] ) ; }
currently only folding top - level nodes .
