code: def document(self):
          
          return self._document_cache[
              self.text, self.cursor_position, self.selection_state]
docs: Return :class:`~prompt_toolkit.document.Document` instance from the
          current text, cursor position and selection state.