no resolve-based Show VCS History for Selection in dumb mode (EA-68875 - INRE: FileBasedIndexImpl.handleDumbMode)

This commit is contained in:
peter
2015-05-28 16:26:50 +02:00
parent 344cdfc966
commit 76a886eef5
@@ -18,6 +18,7 @@ package com.intellij.vcsUtil;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.SelectionModel;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.vcs.actions.VcsContext;
import org.jetbrains.annotations.Nullable;
@@ -35,10 +36,13 @@ public class VcsSelectionUtil {
if (selectionFromEditor != null) {
return selectionFromEditor;
}
final VcsSelectionProvider[] providers = Extensions.getExtensions(VcsSelectionProvider.EP_NAME);
for(VcsSelectionProvider provider: providers) {
final VcsSelection vcsSelection = provider.getSelection(context);
if (vcsSelection != null) return vcsSelection;
for(VcsSelectionProvider provider: Extensions.getExtensions(VcsSelectionProvider.EP_NAME)) {
try {
final VcsSelection vcsSelection = provider.getSelection(context);
if (vcsSelection != null) return vcsSelection;
}
catch (IndexNotReadyException ignored) {
}
}
return null;
}