diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index eb97a4de5ecf..57d265a01eef 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -637,17 +637,20 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp } } } - for (GlobalInspectionContextExtension extension : myExtensions.values()) { - try { - extension.performPostRunActivities(needRepeatSearchRequest, this); + + ReadAction.run(() -> { + for (GlobalInspectionContextExtension extension : myExtensions.values()) { + try { + extension.performPostRunActivities(needRepeatSearchRequest, this); + } + catch (ProcessCanceledException | IndexNotReadyException e) { + throw e; + } + catch (Throwable e) { + LOG.error(e); + } } - catch (ProcessCanceledException | IndexNotReadyException e) { - throw e; - } - catch (Throwable e) { - LOG.error(e); - } - } + }); if (!ApplicationManager.getApplication().isUnitTestMode()) { if (myView == null && !ReadAction.compute(() -> InspectionResultsView.hasProblems(globalTools, this, createContentProvider())).booleanValue()) { return;