public static FormattingDocumentModelImpl createOn(@NotNull PsiFile file) {
    Document document = getDocumentToBeUsedFor(file);
    if (document != null) {
      checkDocument(file, document);
      return new FormattingDocumentModelImpl(document, file);
    }
    else {
      return new FormattingDocumentModelImpl(new DocumentImpl(file.getViewProvider().getContents(), true), file);
    }
  }
public static FormattingDocumentModelImpl createOn(@NotNull PsiFile file)