mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-242883 IncorrectOperationException: You must not call performWhenAllCommitted()/cancelAndRunWhenCommitted() from within after-commit handler
GitOrigin-RevId: cb446ac71163bf4677072d0136408d812d204dd7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bb9b3f41f9
commit
d4203a3c78
@@ -6,6 +6,7 @@ import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -156,6 +157,15 @@ public abstract class PsiDocumentManager {
|
||||
*/
|
||||
public abstract boolean hasUncommitedDocuments();
|
||||
|
||||
/**
|
||||
* @return if any modified documents with event-system-enabled PSI have not been committed.
|
||||
* @see FileViewProvider#isEventSystemEnabled()
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public boolean hasEventSystemEnabledUncommittedDocuments() {
|
||||
return hasUncommitedDocuments();
|
||||
}
|
||||
|
||||
/**
|
||||
* Commits the documents and runs the specified operation, which does not return a value, in a read action.
|
||||
* Can be called from a thread other than the Swing dispatch thread.
|
||||
|
||||
@@ -705,7 +705,7 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
|
||||
!hasEventSystemEnabledUncommittedDocuments();
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
@Override
|
||||
public boolean hasEventSystemEnabledUncommittedDocuments() {
|
||||
return ContainerUtil.exists(myUncommittedDocuments, this::isEventSystemEnabled);
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public abstract class AbstractTreeStructure {
|
||||
public static ActionCallback asyncCommitDocuments(@NotNull Project project) {
|
||||
if (project.isDisposed()) return ActionCallback.DONE;
|
||||
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
|
||||
if (!documentManager.hasUncommitedDocuments()) {
|
||||
if (!documentManager.hasEventSystemEnabledUncommittedDocuments()) {
|
||||
return ActionCallback.DONE;
|
||||
}
|
||||
final ActionCallback callback = new ActionCallback();
|
||||
|
||||
Reference in New Issue
Block a user