diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java index 134b12cb0612..e78fc6dc9af3 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java @@ -20,6 +20,7 @@ package com.intellij.psi.impl.source.tree; import com.intellij.lang.ASTNode; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.ILazyParseableElementType; @@ -167,6 +168,8 @@ public class LazyParseableElement extends CompositeElement { LOG.error("Chameleons must not be parsed till they're in file tree"); } + ApplicationManager.getApplication().assertReadAccessAllowed(); + ILazyParseableElementType type = (ILazyParseableElementType)getElementType(); ASTNode parsedNode = type.parseContents(this); myText = null;