mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
assert that ModelBranch can only be created in a read action (IDEA-CR-65317)
GitOrigin-RevId: 23f917ff162b8d472f900c1704de3257c7c4d86d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3e7725fee7
commit
2e39eb6e2c
@@ -3,6 +3,7 @@ package com.intellij.model;
|
||||
|
||||
import com.intellij.injected.editor.VirtualFileWindow;
|
||||
import com.intellij.model.psi.PsiSymbolReference;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.event.DocumentEvent;
|
||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
||||
@@ -42,6 +43,7 @@ public final class ModelBranchImpl implements ModelBranch {
|
||||
|
||||
private ModelBranchImpl(@NotNull Project project) {
|
||||
myProject = project;
|
||||
ApplicationManager.getApplication().assertReadAccessAllowed();
|
||||
if (PsiDocumentManager.getInstance(project).hasEventSystemEnabledUncommittedDocuments()) {
|
||||
throw new IllegalStateException("Model branches may only be created on committed PSI");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user