use of com.intellij.psi.impl.PsiToDocumentSynchronizer in project intellij-community by JetBrains.
the class FormattingDocumentModelImpl method getDocumentToBeUsedFor.
@Nullable
public static Document getDocumentToBeUsedFor(final PsiFile file) {
final Project project = file.getProject();
final Document document = PsiDocumentManager.getInstance(project).getDocument(file);
if (document == null)
return null;
if (PsiDocumentManager.getInstance(project).isUncommited(document))
return null;
PsiToDocumentSynchronizer synchronizer = ((PsiDocumentManagerImpl) PsiDocumentManager.getInstance(project)).getSynchronizer();
if (synchronizer.isDocumentAffectedByTransactions(document))
return null;
return document;
}
Aggregations