use of com.intellij.openapi.vcs.history.VcsFileRevisionEx in project intellij-community by JetBrains.
the class AnnotateRevisionAction method getFile.
@Nullable
@Override
protected VirtualFile getFile(@NotNull AnActionEvent e) {
VcsFileRevision revision = getFileRevision(e);
if (revision == null)
return null;
final FileType currentFileType = myAnnotation.getFile().getFileType();
FilePath filePath = (revision instanceof VcsFileRevisionEx ? ((VcsFileRevisionEx) revision).getPath() : VcsUtil.getFilePath(myAnnotation.getFile()));
return new VcsVirtualFile(filePath.getPath(), revision, VcsFileSystem.getInstance()) {
@NotNull
@Override
public FileType getFileType() {
FileType type = super.getFileType();
if (!type.isBinary())
return type;
if (!currentFileType.isBinary())
return currentFileType;
return PlainTextFileType.INSTANCE;
}
};
}
Aggregations