Search in sources :

Example 1 with CustomFileHighlighter

use of com.intellij.ide.highlighter.custom.CustomFileHighlighter in project intellij-community by JetBrains.

the class CustomFileTypeFoldingBuilder method buildLanguageFoldRegions.

@Override
protected void buildLanguageFoldRegions(@NotNull List<FoldingDescriptor> descriptors, @NotNull PsiElement root, @NotNull Document document, boolean quick) {
    FileType fileType = root.getContainingFile().getFileType();
    if (!(fileType instanceof CustomSyntaxTableFileType)) {
        return;
    }
    CustomFileHighlighter highlighter = new CustomFileHighlighter(((CustomSyntaxTableFileType) fileType).getSyntaxTable());
    buildBraceMatcherBasedFolding(descriptors, root, document, highlighter);
}
Also used : FileType(com.intellij.openapi.fileTypes.FileType) CustomSyntaxTableFileType(com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType) CustomFileHighlighter(com.intellij.ide.highlighter.custom.CustomFileHighlighter) CustomSyntaxTableFileType(com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType)

Aggregations

CustomFileHighlighter (com.intellij.ide.highlighter.custom.CustomFileHighlighter)1 FileType (com.intellij.openapi.fileTypes.FileType)1 CustomSyntaxTableFileType (com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType)1