(self, current_word)
Update the displayed list by filtering self.completion_list based on
        the current_word under the cursor (see check_can_complete).

        If we're not updating the list with new completions, we filter out
        textEdit completions, since it's difficult to apply them correctly
        after the user makes edits.

        If no items are left on the list the autocompletion should stop
Update the displayed list by filtering self.completion_list based on
        the current_word under the cursor (see check_can_complete).
Update the displayed list by filtering self . completion_list based on the current_word under the cursor ( see check_can_complete ) .
def update_list(self, current_word):
        """
        Update the displayed list by filtering self.completion_list based on
        the current_word under the cursor (see check_can_complete).

        If we're not updating the list with new completions, we filter out
        textEdit completions, since it's difficult to apply them correctly
        after the user makes edits.

        If no items are left on the list the autocompletion should stop
        """
        self.clear()

        self.display_index = []
        height = self.item_height
        width = self.item_width

        if current_word:
            for c in self.completion_list:
                c['end'] = c['start'] + len(current_word)

        for i, completion in enumerate(self.completion_list):
            text = completion['text']
            if not self.check_can_complete(text, current_word):
                continue
            item = QListWidgetItem()
            self.set_item_display(
                item, completion, height=height, width=width)
            item.setData(Qt.UserRole, completion)

            self.addItem(item)
            self.display_index.append(i)

        if self.count() == 0:
            self.hide()
def update_list ( self , current_word ) : self . clear ( ) self . display_index = [ ] height = self . item_height width = self . item_width if current_word : for c in self . completion_list : c [ 'end' ] = c [ 'start' ] + len ( current_word ) for i , completion in enumerate ( self . completion_list ) : text = completion [ 'text' ] if not self . check_can_complete ( text , current_word ) : continue item = QListWidgetItem ( ) self . set_item_display ( item , completion , height = height , width = width ) item . setData ( Qt . UserRole , completion ) self . addItem ( item ) self . display_index . append ( i ) if self . count ( ) == 0 : self . hide ( )