parameters: (self)
docstring: Return (new_text, new_cursor_position) for this completion.
docstring_summary: Return (new_text, new_cursor_position) for this completion.
docstring_tokens: Return ( new_text new_cursor_position ) for this completion .
function: def new_text_and_position(self) -> Tuple[str, int]:
          """
          Return (new_text, new_cursor_position) for this completion.
          """
          if self.complete_index is None:
              return self.original_document.text, self.original_document.cursor_position
          else:
              original_text_before_cursor = self.original_document.text_before_cursor
              original_text_after_cursor = self.original_document.text_after_cursor
  
              c = self.completions[self.complete_index]
              if c.start_position == 0:
                  before = original_text_before_cursor
              else:
                  before = original_text_before_cursor[: c.start_position]
  
              new_text = before + c.text + original_text_after_cursor
              new_cursor_position = len(before) + len(c.text)
              return new_text, new_cursor_position
function_tokens: def new_text_and_position ( self ) -> Tuple [ str , int ] : if self . complete_index is None : return self . original_document . text , self . original_document . cursor_position else : original_text_before_cursor = self . original_document . text_before_cursor original_text_after_cursor = self . original_document . text_after_cursor c = self . completions [ self . complete_index ] if c . start_position == 0 : before = original_text_before_cursor else : before = original_text_before_cursor [ : c . start_position ] new_text = before + c . text + original_text_after_cursor new_cursor_position = len ( before ) + len ( c . text ) return new_text , new_cursor_position