From ddcdd7b8e49a941ef6823db02ae225e9766116e8 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 2 May 2012 13:11:46 +0400 Subject: [PATCH] EA-35790 - assert: PsiDocumentManagerImpl.commitAllDocuments async editor initialization --- .../ide/util/treeView/smartTree/SmartTreeStructure.java | 3 --- .../lang/properties/editor/ResourceBundleEditor.java | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/SmartTreeStructure.java b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/SmartTreeStructure.java index c8bde1879bce..7db150821b82 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/SmartTreeStructure.java +++ b/platform/lang-impl/src/com/intellij/ide/util/treeView/smartTree/SmartTreeStructure.java @@ -32,11 +32,9 @@ public class SmartTreeStructure extends AbstractTreeStructure { public SmartTreeStructure(@NotNull Project project, @NotNull TreeModel model) { myModel = model; myProject = project; - } public void commit() { - PsiDocumentManager.getInstance(myProject).commitAllDocuments(); } @NotNull @@ -54,7 +52,6 @@ public class SmartTreeStructure extends AbstractTreeStructure { public Object getRootElement() { if (myRootElementWrapper == null){ - PsiDocumentManager.getInstance(myProject).commitAllDocuments(); myRootElementWrapper = createTree(); } return myRootElementWrapper; diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java index 78b8859f0af9..7ddb4d84ba25 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java @@ -300,7 +300,12 @@ public class ResourceBundleEditor extends UserDataHolderBase implements FileEdit private final Alarm myUpdateEditorAlarm = new Alarm(); private void selectionChanged() { myBackSlashPressed.clear(); - updateEditorsFromProperties(); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + updateEditorsFromProperties(); + } + }); } private void updateEditorsFromProperties() {