parameters: (self, completions, go_to_first=True, go_to_last=False)
docstring: Start completions. (Generate list of completions and initialize.)
docstring_summary: Start completions. (Generate list of completions and initialize.)
docstring_tokens: Start completions . ( Generate list of completions and initialize . )
function: def set_completions(self, completions, go_to_first=True, go_to_last=False):
          """
          Start completions. (Generate list of completions and initialize.)
          """
          assert not (go_to_first and go_to_last)
  
          # Generate list of all completions.
          if completions is None:
              if self.completer:
                  completions = list(self.completer.get_completions(
                      self.document,
                      CompleteEvent(completion_requested=True)
                  ))
              else:
                  completions = []
  
          # Set `complete_state`.
          if completions:
              self.complete_state = CompletionState(
                  original_document=self.document,
                  current_completions=completions)
              if go_to_first:
                  self.go_to_completion(0)
              elif go_to_last:
                  self.go_to_completion(len(completions) - 1)
              else:
                  self.go_to_completion(None)
  
          else:
              self.complete_state = None
function_tokens: def set_completions ( self , completions , go_to_first = True , go_to_last = False ) : assert not ( go_to_first and go_to_last ) # Generate list of all completions. if completions is None : if self . completer : completions = list ( self . completer . get_completions ( self . document , CompleteEvent ( completion_requested = True ) ) ) else : completions = [ ] # Set `complete_state`. if completions : self . complete_state = CompletionState ( original_document = self . document , current_completions = completions ) if go_to_first : self . go_to_completion ( 0 ) elif go_to_last : self . go_to_completion ( len ( completions ) - 1 ) else : self . go_to_completion ( None ) else : self . complete_state = None