use of org.elixir_lang.beam.psi.BeamFileImpl in project intellij-elixir by KronicDeth.
the class StructureViewBuilderProvider method getStructureViewBuilder.
/**
* Returns the structure view builder for the specified file.
*
* @param fileType file type of the file to provide structure for
* @param virtualFile The file for which the structure view builder is requested.
* @param project The project to which the file belongs.
* @return The structure view builder, or null if no structure view is available for the file.
*/
@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(@NotNull FileType fileType, @NotNull VirtualFile virtualFile, @NotNull Project project) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile);
StructureViewBuilder structureViewBuilder = null;
if (psiFile instanceof BeamFileImpl) {
BeamFileImpl beamFileImpl = (BeamFileImpl) psiFile;
PsiElement mirror = beamFileImpl.getMirror();
if (mirror instanceof ElixirFile) {
structureViewBuilder = Factory.structureViewBuilder((ElixirFile) mirror);
}
}
return structureViewBuilder;
}
use of org.elixir_lang.beam.psi.BeamFileImpl in project intellij-elixir by KronicDeth.
the class ModuleElementImpl method getMirror.
/**
* Returns the corresponding PSI element in a decompiled file created by IDEA from
* the library element.
*
* @return the counterpart of the element in decompiled file.
*/
@Override
public PsiElement getMirror() {
TreeElement nonVolatileMirror = mirror;
if (nonVolatileMirror == null) {
((BeamFileImpl) getContainingFile()).getMirror();
nonVolatileMirror = mirror;
}
return SourceTreeToPsiMap.treeElementToPsi(nonVolatileMirror);
}
Aggregations