node: add a test for PackageJsonCompletionContributor in dumb mode (IDEA-CR-59487)

GitOrigin-RevId: 9c69cc3c80d2bff927fdad65a7005f754f71e067
This commit is contained in:
Sergey Simonchik
2020-03-20 18:02:14 +00:00
committed by intellij-monorepo-bot
parent 7c5b831d25
commit 693734e469
@@ -247,6 +247,17 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
}
}
@TestOnly
public void runInDumbMode(@NotNull Runnable runnable) {
setDumb(true);
try {
runnable.run();
}
finally {
setDumb(false);
}
}
@Override
public void runWhenSmart(@Async.Schedule @NotNull Runnable runnable) {
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> unsafeRunWhenSmart(runnable));