cache the eagerly created PSI, otherwise creating it makes no sense

This commit is contained in:
peter
2010-06-16 21:03:13 +04:00
parent 2202e44a67
commit a91c7c0bcb
2 changed files with 6 additions and 2 deletions
@@ -513,10 +513,14 @@ public class CompositeElement extends TreeElement {
wrapper = myWrapper;
if (wrapper != null) return wrapper;
return myWrapper = createPsiNoLock();
return getPsiNoLock();
}
}
final PsiElement getPsiNoLock() {
return myWrapper = createPsiNoLock();
}
protected PsiElement createPsiNoLock() {
final Language lang = getElementType().getLanguage();
final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(lang);
@@ -36,7 +36,7 @@ public class LazyParseableElement extends CompositeElement {
@Override
public void visitComposite(CompositeElement composite) {
composite.createPsiNoLock();
composite.getPsiNoLock();
super.visitComposite(composite);
}