// Path: src/cmake/filetypes/CMakeFile.java
// public class CMakeFile extends PsiFileBase{
//     public static CMakeFile create(@NotNull FileViewProvider viewProvider) {
//         return new CMakeFile(viewProvider);
//     }
//     protected CMakeFile(@NotNull FileViewProvider viewProvider) {
//         super(viewProvider, CMakeLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public FileType getFileType() {
//         return CMakeFileType.INSTANCE;
//     }
// 
//     @Override
//     public String toString() {
//         return "CMake";
//     }
// 
//     @Override
//     public Icon getIcon(int flags) {
//         return super.getIcon(flags);
//     }
// }


import cmake.filetypes.CMakeFile;
import com.intellij.lang.ASTNode;
import com.intellij.lang.folding.FoldingBuilderEx;
import com.intellij.lang.folding.FoldingDescriptor;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.PsiElementProcessor;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import cmake.psi.CMakeTypes;
import java.util.List;
package cmake.global;



/**
 * Created by alex on 12/31/14.
 */
public class CMakeFoldingBuilder extends FoldingBuilderEx implements DumbAware {
    @NotNull
    @Override
    public FoldingDescriptor[] buildFoldRegions(@NotNull PsiElement root, @NotNull Document document, boolean quick) {
// Path: src/cmake/filetypes/CMakeFile.java
// public class CMakeFile extends PsiFileBase{
//     public static CMakeFile create(@NotNull FileViewProvider viewProvider) {
//         return new CMakeFile(viewProvider);
//     }
//     protected CMakeFile(@NotNull FileViewProvider viewProvider) {
//         super(viewProvider, CMakeLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public FileType getFileType() {
//         return CMakeFileType.INSTANCE;
//     }
// 
//     @Override
//     public String toString() {
//         return "CMake";
//     }
// 
//     @Override
//     public Icon getIcon(int flags) {
//         return super.getIcon(flags);
//     }
// }


// Path: src/cmake/global/CMakeFoldingBuilder.java
import cmake.filetypes.CMakeFile;
import com.intellij.lang.ASTNode;
import com.intellij.lang.folding.FoldingBuilderEx;
import com.intellij.lang.folding.FoldingDescriptor;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.PsiElementProcessor;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import cmake.psi.CMakeTypes;
import java.util.List;

package cmake.global;



/**
 * Created by alex on 12/31/14.
 */
public class CMakeFoldingBuilder extends FoldingBuilderEx implements DumbAware {
    @NotNull
    @Override
    public FoldingDescriptor[] buildFoldRegions(@NotNull PsiElement root, @NotNull Document document, boolean quick) {
        if (!(root instanceof CMakeFile)) return FoldingDescriptor.EMPTY;