explicit assertion for starting find usages from within write action

This commit is contained in:
Alexey Kudravtsev
2017-08-16 14:34:43 +03:00
parent 1d262171ae
commit 55533e435b
@@ -128,6 +128,9 @@ public class UsageViewManagerImpl extends UsageViewManager {
@NotNull final UsageViewPresentation presentation,
@NotNull final FindUsagesProcessPresentation processPresentation,
@Nullable final UsageViewStateListener listener) {
if (ApplicationManager.getApplication().isWriteAccessAllowed()) {
throw new IllegalStateException("Can't start find usages from under write action. Please consider Application.invokeLater() it instead.");
}
final SearchScope searchScopeToWarnOfFallingOutOf = getMaxSearchScopeToWarnOfFallingOutOf(searchFor);
final AtomicReference<UsageViewImpl> usageViewRef = new AtomicReference<>();
long start = System.currentTimeMillis();