From b4850c0cd1c4cfe3defd7dffef4721f46726ce3f Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 2 Oct 2010 18:08:46 +0400 Subject: [PATCH] diagnostics: chameleons may not be expanded outside read action --- .../intellij/psi/impl/source/tree/LazyParseableElement.java | 3 +++ 1 file changed, 3 insertions(+) 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;