diff --git a/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java b/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java index 76377ef6b98e..8b57843d6b9f 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java @@ -554,4 +554,16 @@ public class DocumentCommitThread extends DocumentCommitProcessor implements Run boolean isEnabled() { return myEnabled; } + + @TestOnly + public void waitUntilAllCommitted() throws InterruptedException { + if (!myEnabled) { + throw new IllegalStateException("DocumentCommitThread is disabled"); + } + synchronized (documentsToCommit) { + while(!documentsToCommit.isEmpty()) { + documentsToCommit.wait(); + } + } + } }