html reparse fix

This commit is contained in:
no_reply@jetbrains.com
2005-01-26 15:13:04 +03:00
parent 82cb5be55c
commit df2896c6c7
2 changed files with 9 additions and 6 deletions
@@ -118,11 +118,12 @@ public class PomModelImpl extends UserDataHolderBase implements PomModel {
PomModelAspect aspect) throws IncorrectOperationException{
final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
if(progressIndicator != null) progressIndicator.startNonCancelableSection();
final PsiDocumentManagerImpl manager = (PsiDocumentManagerImpl)PsiDocumentManager.getInstance(myPomProject.getPsiProject());
final PsiToDocumentSynchronizer synchronizer = manager.getSynchronizer();
Document document = null;
try{
synchronized(PsiLock.LOCK){
final PsiDocumentManagerImpl manager = (PsiDocumentManagerImpl)PsiDocumentManager.getInstance(myPomProject.getPsiProject());
final PsiToDocumentSynchronizer synchronizer = manager.getSynchronizer();
Document document = null;
if(transaction.getChangeScope().getContainingFile() != null) {
document = manager.getDocument(transaction.getChangeScope().getContainingFile());
}
@@ -137,7 +138,6 @@ public class PomModelImpl extends UserDataHolderBase implements PomModel {
return;
}
finally{
if(document != null) synchronizer.commitTransaction(document);
myBlockedAspects.pop();
}
@@ -157,6 +157,7 @@ public class PomModelImpl extends UserDataHolderBase implements PomModel {
}
}
finally{
if(document != null) synchronizer.commitTransaction(document);
if(progressIndicator != null) progressIndicator.finishNonCancelableSection();
}
}
@@ -52,12 +52,14 @@ public class PsiToDocumentSynchronizer extends PsiTreeChangeAdapter {
boolean isOriginal = isOriginal(event.getParent(), psiFile, document);
if (isOriginal) {
final boolean insideTransaction = myTransactionsMap.containsKey(document);
myPsiDocumentManager.setProcessDocumentEvents(false);
syncAction.syncDocument(document, (PsiTreeChangeEventImpl)event);
if(!insideTransaction) document.setModificationStamp(psiFile.getModificationStamp());
myPsiDocumentManager.setProcessDocumentEvents(true);
if(!myTransactionsMap.containsKey(document)){
document.setModificationStamp(psiFile.getModificationStamp());
if(!insideTransaction){
mySmartPointerManager.synchronizePointers(psiFile);
if (LOG.isDebugEnabled()) {
PsiDocumentManagerImpl.checkConsistency(psiFile, document);