Search in sources :

Example 1 with CfmlFileViewProvider

use of com.intellij.coldFusion.model.files.CfmlFileViewProvider in project intellij-plugins by JetBrains.

the class CfmlStructureViewTest method createStructureViewModel.

private StructureView createStructureViewModel() {
    VirtualFile virtualFile = myFixture.getFile().getVirtualFile();
    final FileType fileType = virtualFile.getFileType();
    final StructureViewBuilder structureViewBuilder;
    if (fileType == CfmlFileType.INSTANCE) {
        CfmlFileViewProvider viewProvider = (CfmlFileViewProvider) myFixture.getFile().getViewProvider();
        structureViewBuilder = LanguageStructureViewBuilder.INSTANCE.forLanguage(viewProvider.getBaseLanguage()).getStructureViewBuilder(viewProvider.getPsi(viewProvider.getBaseLanguage()));
    } else {
        structureViewBuilder = StructureViewBuilder.PROVIDER.getStructureViewBuilder(fileType, virtualFile, getProject());
    }
    return structureViewBuilder.createStructureView(FileEditorManager.getInstance(getProject()).getSelectedEditor(virtualFile), getProject());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) LanguageStructureViewBuilder(com.intellij.lang.LanguageStructureViewBuilder) StructureViewBuilder(com.intellij.ide.structureView.StructureViewBuilder) FileType(com.intellij.openapi.fileTypes.FileType) CfmlFileType(com.intellij.coldFusion.model.files.CfmlFileType) CfmlFileViewProvider(com.intellij.coldFusion.model.files.CfmlFileViewProvider)

Aggregations

CfmlFileType (com.intellij.coldFusion.model.files.CfmlFileType)1 CfmlFileViewProvider (com.intellij.coldFusion.model.files.CfmlFileViewProvider)1 StructureViewBuilder (com.intellij.ide.structureView.StructureViewBuilder)1 LanguageStructureViewBuilder (com.intellij.lang.LanguageStructureViewBuilder)1 FileType (com.intellij.openapi.fileTypes.FileType)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1