IDEA-155362 Open In Browser : action should work for files versons from History or...
authorVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Fri, 29 Apr 2016 13:26:12 +0000 (15:26 +0200)
committerVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Fri, 29 Apr 2016 13:26:12 +0000 (15:26 +0200)
xml/impl/src/com/intellij/ide/browsers/actions/BaseOpenInBrowserAction.java

index dcf8d0895108106c2a9a19675453ceaab3510d82..fef95a6024708d499f710e8c56acd23bd792e92b 100644 (file)
@@ -30,6 +30,7 @@ import com.intellij.openapi.project.DumbAwareAction;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.vcs.vfs.ContentRevisionVirtualFile;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiElement;
@@ -118,7 +119,7 @@ public abstract class BaseOpenInBrowserAction extends DumbAwareAction {
         if (psiFile == null) {
           psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
         }
-        if (psiFile != null) {
+        if (psiFile != null && !(psiFile.getVirtualFile() instanceof ContentRevisionVirtualFile)) {
           return new OpenInBrowserRequest(psiFile) {
             private PsiElement element;
 
@@ -142,7 +143,7 @@ public abstract class BaseOpenInBrowserAction extends DumbAwareAction {
         psiFile = PsiManager.getInstance(project).findFile(virtualFile);
       }
 
-      if (psiFile != null) {
+      if (psiFile != null && !(psiFile.getVirtualFile() instanceof ContentRevisionVirtualFile)) {
         return OpenInBrowserRequest.create(psiFile);
       }
     }