code: def __insert_completion(self, completion):
          
  
          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)
docs: Inserts the completion text in the current document.
  
          :param completion: Completion text.
          :type completion: QString