private void doClearCaches(String reason) { final FileElement tree = getTreeElement(); if (tree != null) { tree.clearCaches(); } synchronized (PsiLock.LOCK) { clearStub(reason); } if (tree != null) { tree.putUserData(STUB_TREE_IN_PARSED_TREE, null); } clearCaches(); }
public void unloadContent() { ApplicationManager.getApplication().assertWriteAccessAllowed(); clearCaches(); myViewProvider.beforeContentsSynchronized(); synchronized (PsiLock.LOCK) { FileElement treeElement = derefTreeElement(); DebugUtil.startPsiModification("unloadContent"); try { if (treeElement != null) { myTreeElementPointer = null; treeElement.detachFromFile(); DebugUtil.onInvalidated(treeElement); } clearStub("unloadContent"); } finally { DebugUtil.finishPsiModification(); } } }