diff --git a/plugin/cpanminus/src/main/java/com/perl5/lang/perl/cpanminus/adapter/CpanminusAdapter.java b/plugin/cpanminus/src/main/java/com/perl5/lang/perl/cpanminus/adapter/CpanminusAdapter.java index 0c6da62f20..8661d1baf4 100644 --- a/plugin/cpanminus/src/main/java/com/perl5/lang/perl/cpanminus/adapter/CpanminusAdapter.java +++ b/plugin/cpanminus/src/main/java/com/perl5/lang/perl/cpanminus/adapter/CpanminusAdapter.java @@ -16,6 +16,7 @@ package com.perl5.lang.perl.cpanminus.adapter; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.util.NlsSafe; @@ -85,7 +86,7 @@ public static boolean isAvailable(@Nullable Project project) { public static final class Factory implements PackageManagerAdapterFactory { @Override public @Nullable CpanminusAdapter createAdapter(@NotNull Sdk sdk, @Nullable Project project) { - return isAvailable(project) ? new CpanminusAdapter(sdk, project) : null; + return ReadAction.compute(() -> isAvailable(project) ? new CpanminusAdapter(sdk, project) : null); } @VisibleForTesting diff --git a/plugin/src/test/java/run/PerlRunTest.java b/plugin/src/test/java/run/PerlRunTest.java index 44c324563f..b0d160dddb 100644 --- a/plugin/src/test/java/run/PerlRunTest.java +++ b/plugin/src/test/java/run/PerlRunTest.java @@ -133,7 +133,7 @@ public void testMissingPackageNotification() { assertNotNull(notification); assertEquals(PerlBundle.message("perl.missing.library.notification"), notification.getGroupId()); assertEquals(PerlBundle.message("perl.missing.library.notification.title", "Some::Missing::Module"), notification.getTitle()); - assertSize(2, notification.getActions()); + assertSize(1, notification.getActions()); assertEquals(PerlBundle.message("perl.missing.library.notification.message"), notification.getContent()); }