code: def go_to_completion(self, index):
          
          assert index is None or isinstance(index, int)
          assert self.complete_state
  
          # Set new completion
          state = self.complete_state.go_to_index(index)
  
          # Set text/cursor position
          new_text, new_cursor_position = state.new_text_and_position()
          self.document = Document(new_text, new_cursor_position)
  
          # (changing text/cursor position will unset complete_state.)
          self.complete_state = state
docs: Select a completion from the list of current completions.