'Generates diff between the original doc_comment and its fix
new_comment which are instances of DocumentationComment.
:param doc_comment:
Original instance of DocumentationComment.
:param new_comment:
Fixed instance of DocumentationComment.
:return:
Diff instance.'

@staticmethod
def generate_diff(file, doc_comment, new_comment):

    diff = Diff(file)
    old_range = TextRange.from_values(doc_comment.range.start.line, 1, doc_comment.range.end.line, doc_comment.range.end.column)
    new_comment.assemble.cache_clear()
    diff.replace(old_range, new_comment.assemble())
    return diff
