<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __insert_completion(self, completion):
 """ Inserts the completion text in the current document. :param completion: Completion text. :type completion: QString """


        LOGGER.debug("> Inserting '{0}' completion.".format(completion))

        text_cursor = self.textCursor()
        extra = (completion.length() - self.__completer.completion_prefix().length())
        text_cursor.insertText(completion.right(extra))
        self.setTextCursor(text_cursor)