diagnostics: chameleons may not be expanded outside read action

This commit is contained in:
peter
2010-10-02 18:08:46 +04:00
parent fc8fde5ec0
commit b4850c0cd1
@@ -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;